One of the new features in Entity Framework 4.0 (EF v2) is a service call “Pluralization”. This service is used to convert names of objects form singular and/or plural forms. For instance, if you have a table in the database that has a plural name such as “Customers”, then Entity Framework will automatically generate both object Name and Entity Set Name to “Customers” as well. The result is that in your code, the name will look like this:
Customers c = new Customers();
Ideally, it would have been nice for EF to see that the table was a plural name and set the object Name to a singular form.
Now, you may be thinking that this is pretty trivial since you can manually change the generated name, but when when you have dozens or hundreds of tables this can be tedious at best.
To use the PluralizationService when generating an Entity Framework model, you just select the option"Pluralize or singularize generated object names”
Orjinal yazı için...
Hiç yorum yok:
Yorum Gönder