Print Page | Close Window

Name Pluralizer - Invalid EntityType name

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1702
Printed Date: 25-Apr-2024 at 7:31am


Topic: Name Pluralizer - Invalid EntityType name
Posted By: fcazabon
Subject: Name Pluralizer - Invalid EntityType name
Date Posted: 29-Mar-2010 at 11:21am

Hi,

I'm brand new to DevForce and am working through the the Introductory material.  I'm trying to follow the walkthrough of creating an application, but using my own database and I get an error:

'Email' is an invalid EntityType name because member names cannot b ethe same as that of the enclosing type

I imagine this is because I have a table in my database called Emails with a field called Email.  How do I work around this without changing the underlying field name?




Replies:
Posted By: IdeaBlade
Date Posted: 31-Mar-2010 at 10:14am
Originally posted by fcazabon

I get an error:

'Email' is an invalid EntityType name because member names cannot be the same as that of the enclosing type

I imagine this is because I have a table in my database called Emails with a field called Email.  How do I work around this without changing the underlying field name?



It's an Entity Framework restriction that the name of a property can't be the same as the name of its containing entity. The problem is occurring because the pluralizer is attempt to make the entity name singular, which causes it to conflict with the property name.

You can work around this by renaming the property (or the entity) before running the pluralizer, so that the entity name, when singularized, doesn't conflict with the property name.


Posted By: fcazabon
Date Posted: 31-Mar-2010 at 11:15am
Thanks.  


Posted By: daniel.jashua
Date Posted: 01-Apr-2010 at 4:28am
Its time..!! And timely post and advice as far as I am concern..!!
Keep posting good stuff like this...!!

TIA.
.



-------------
http://www.pcnametag.com/product-Sporty2_No_Spin_Necklace-262.aspx - lanyard necklace | http://www.pcnametag.com/product-Sporty2_No_Spin_Necklace-262.aspx - best lanyard necklace



Print Page | Close Window