New Posts New Posts RSS Feed: Get EntityGroup Name From Entity Name
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Get EntityGroup Name From Entity Name

 Post Reply Post Reply
Author
mbevins1 View Drop Down
Newbie
Newbie


Joined: 16-Jan-2009
Posts: 27
Post Options Post Options   Quote mbevins1 Quote  Post ReplyReply Direct Link To This Post Topic: Get EntityGroup Name From Entity Name
    Posted: 15-Jul-2009 at 11:39am

Is there a way to get the EntityGroup Name from the Entity Name?

Entity Name = Vehicle
 
Get Group Name of Vehicles?
 
I would just add S to the end of the name but that may not always be correct.
 
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 15-Jul-2009 at 4:35pm
The EntityGroup name is probably not what you're after, since that name will be something like "DomainModel:Customer".  The "entity set name" is probably what you're looking for.  The entity set name is primarily a logical container for entities and is used by the Entity Framework.  In DevForce, it's the entity set name which is used for the generated queries on the EntityManager (eg, "Vehicles") and a DefaultEntitySetName attribute also adorns generated entities.  There is actually a subtle difference between a default entity set name for an entity type and the actual entity set name an instance of the type belongs to, but in most applications only the default entity set name is ever used.  You can get this name through the EntityMetadata -
 
   aVehicle.GetEntityMetadata().DefaultEntitySetName;
or
  entityManager.MetadataStore.GetEntityMetadata(typeof(Vehicle)).DefaultEntitySetName;
 
Back to Top
mbevins1 View Drop Down
Newbie
Newbie


Joined: 16-Jan-2009
Posts: 27
Post Options Post Options   Quote mbevins1 Quote  Post ReplyReply Direct Link To This Post Posted: 16-Jul-2009 at 4:14am
Your are right, Thanks
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down