Base solution for your next web application
Open Closed

Repository Advice #1208


User avatar
0
tjackadams created

Hello,

just looking for some advice/points on the database context/repositories.

Abp is setup and working fine with a MSSQL database.

We are looking to start querying and updating another database which is MySql. Now this database is already populated with tables and information and its not feasible to change the schema.

I've created the code first classes and setup and new dbcontext.

My question is, is it possible to use the repositories somehow? My code first classes are not inheriting from type Entity, as this would cause a database migration.

Is there another class/interface i can inherit from to still use the repositories?

Any help is appreciated. Thanks


1 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    You can directly implement IEntity<TPrimaryKey> or IEntity (for int PK) for your entities if they have an Id property. Thus, you don't have to derive from Entity class. If they have no Id property, then no way to use default repositories since repositories works with Id property.