What are the basic rules for designing a class structure to map a relational database?

The WPF application should be the visualizer interface for the ERP database (in fact, this is only a small part). They are connected through web services.

What are the basic rules for developing a data model class structure for mapping database tables? For example, should it be one large flat class with many members or many classes representing different tables in the database?

+4
source share
1 answer

If at all possible, use a standard Object / Relational Mapper (ORM) such as NHibernate, LINQ to SQL, or Entity Framework.

Typically, they have wizards that can generate an object model based on a database schema. By default, the default approach is to create a class for the table, which makes a lot of sense.

If your database is patented and you cannot work with standard ORM, I would recommend that you take one of them to understand how they model relational databases. This should quickly answer most of your questions in this regard.

+4
source

All Articles