Search code examples
c#databaseentity-frameworkcode-first

Should user codefirst entityframework for database large (> 60 table)


I'm doing project have 60 table in data base, I should use codefirst or datafirst entityframe work


Solution

  • Regardless of the number of tables it would really depend on those required for your domain model. Is all 60 of them required for modelling your domain problem?

    You may want to think about bounded contexts to split your domain model down into specific areas of your application. A large graph of entities can get messy.

    It can be achieved either way using code first and preventing the database from being materialised from your Fluent API mappings or modelling your domain model from a database in an EDMX file.