The short example about EF4 CTP4 using DataAnnotation configuration

added by thangchung
8/3/2010 7:56:17 AM

1 Kicks, 111 Views

In the last post at here, here and here, I wrote about EF4 (Entity Framework 4) with code-first approaching. In 3 parts, I used the configuration class for mapping with database (this feature is like Fluent NHibernate). But in the CTP4, we also use the DataAnnotation (new feature in .NET 4) for mapping with database. If we use the DataAnnotation, we shall be easy to mapping with much Convention over Configuration rules. You can go to this link for read all convention’s EF4 CTP. As Andrew suggest me, the example for mapping of my last post is very simple and did not have complex....