Entity Framework 4: which approach is the best

I know that similar questions have been asked before.

I start with a set of xsd-generated data objects (plus the db model), and you need to keep these almost 1: 1 in the same SQL Server database. The number of objects is small (10), and the logic required to insert / update / delete db (mainly upserts) is subtle (albeit some).

I am wondering which approach is best?

  • no ORM with SQL Server stored processes, probably generated using T4 or something like codeSmith
  • Entity Fx, generate entities from Db and manually map xsd entities to EFx objects at runtime
  • Entity Fx, create an edmx file from the database, then use the POCO approach and directly save the xsd-generated objects (after manually encoding the ObjectContext class, which I assume)
  • code-only EFx approach (looks like one of the most idiotic ideas I've ever seen)
  • anything else?

I am particularly interested in maintenance - what happens if a property is added to objects generated by XSD, how much effort each approach takes.

I would have a desire to go with 1, since the logic is subtle and there are no complex mappings (m: n). But it would be possible that the data model would evolve into a more complex domain model, and we do not want to overestimate anything.

How bad is each EFx approach harmful to runtime performance?

+3
1

.

3, , , - Entity Framework (System.Data.Entity). , Entity/DAL/BL , 3. . , , EF, 1 2 .

, , Entity Framework .

+1

Source: https://habr.com/ru/post/1744326/


All Articles