Code First is probably the most preferred way to build an Entity Data Model that can be used with Entity Framework to perform data access. Database First and Model First are the also quite important but less used. In Code First modeling, you define your domain classes and mapping in.. code (yeap this is where it's name comes from). You need to know that Code First is all about conventions and configurations. For example, it assumes that each of your domain classes have a key property otherwise you will get an exception. If a property on a domain class ends with "Id" it is going to be treated as a key property automatically, otherwise you will have to annotate at least on property with the [Key] annotation. We 'll skip the theory and will go straight forward to practice. In this post we will see how to use Code First to:


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials,Entity Framework,Code First in Entity Framework