What is the difference between sql table adapter and entity model?

They seem to create classes based on the database schema. Why are you using an entity framework model over a table adapter?

They both allow me to easily drag the sql table to the surface in Visual Studio, after which the class and all the code are generated, which allows me to automatically create / update / delete records.

I know that entity structure is a clear choice, I just don't understand why.

Thanks!

+4
source share
1 answer

The Data-Set, Data-table, and Data-row offer a relational API β€” these are your RDBMS objects displayed as objects in the .NET world. You cannot have an inheritance. You have no graphic structures.

EF, on the other hand, allows you to model your objects the way you want, and then map them to an RDBMS schema so that it can control the save part. With EF you can work with a conceptual (domain) model, and not with a relational model. For example, an EF object can be designed from several tables, or you can have several objects built on the same table (for example, an inheritance script).

+3
source

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


All Articles