New Posts New Posts RSS Feed: Name Pluralizer - Invalid EntityType name
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Name Pluralizer - Invalid EntityType name

 Post Reply Post Reply
Author
fcazabon View Drop Down
Newbie
Newbie
Avatar

Joined: 29-Mar-2010
Location: Trinidad
Posts: 2
Post Options Post Options   Quote fcazabon Quote  Post ReplyReply Direct Link To This Post Topic: Name Pluralizer - Invalid EntityType name
    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?

Back to Top
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
fcazabon View Drop Down
Newbie
Newbie
Avatar

Joined: 29-Mar-2010
Location: Trinidad
Posts: 2
Post Options Post Options   Quote fcazabon Quote  Post ReplyReply Direct Link To This Post Posted: 31-Mar-2010 at 11:15am
Thanks.  
Back to Top
daniel.jashua View Drop Down
Newbie
Newbie


Joined: 01-Apr-2010
Posts: 1
Post Options Post Options   Quote daniel.jashua Quote  Post ReplyReply Direct Link To This Post 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.
.

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down