Entity Framework 4.0 – 2

Error 3 Error 5: The ‘Namespace’ attribute is invalid – The value ‘‘ is invalid according to its data type ‘http://schemas.microsoft.com/ado/2008/09/edm:TNamespaceName’ – The Pattern constraint failed.

This error may come up when you try to add a new blank “Ado.Net Entity Data Model” to your project and name the EDM with a character line _(underscore),-(hyphen), etc. in the name. I got this for this two values and there must be more.

The way to solve this error is to name the EDM without any special character in it.

This is for the records J

ADO.Net Entity Framework 4.0 – 1

Entity Framework 4.0: Pluralize or singularize generated object names

image

One of the main additions to the Entity Framework 4.0 is the checkbox shown in the screenshot below:

Pluralize or singularize generated object names

In the previous versions of Entity Framework, by default the Entity Set Name and Entity Name were same, shown the screen shot below:

clip_image004

This caused a lot of confusion for the developers when they started coding against the model.

In Entity Framework 4.0 a new feature has been introduced via the check box mentioned above. This check box is selected by default and provides, amongst others, for the pluralization or singularization of the Entity name. This checkbox practically follows the rule wherein it marked all Entity Types as singular and the Entity Set name as plural. Below is an example wherein this checkbox has been used to pluralize the Entity Set Name. You can uncheck the control to get back to the older – both name same format.

clip_image005