Search code examples
c#variablesentityfieldrelate

Best Aproach to Relate A Entity Class to the Correspoding Table in a DataBase


i want to relate each Field of an Entity Class to the corresponding datatable Field. im working on c# currently

Any Suggestions?


Solution

  • The Entity Framework does exactly that, and very well. It also does a whole lot more such as let you write strong typed LINQ queries directly from your application code.

    your other good options are NHibernate or Linq to SQL

    this class of frameworks is generally called Object Relational Mapper (ORM)

    I would say Entity Framework offers the most conveniences for beginners such as visually configuring your data model. it can infer your object model from your database or it can create a database for you from your object model.

    The new Entity Framework Code First approach is incredibly simple and powerful in my opinion Link