New Posts New Posts RSS Feed: Determining Column Properties at Runtime
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Determining Column Properties at Runtime

 Post Reply Post Reply
Author
danielp37 View Drop Down
Newbie
Newbie


Joined: 18-Mar-2008
Location: United States
Posts: 29
Post Options Post Options   Quote danielp37 Quote  Post ReplyReply Direct Link To This Post Topic: Determining Column Properties at Runtime
    Posted: 11-Jun-2008 at 7:38am
What would be the best way to determine which properties on a DEF Entity are for DB columns at runtime.  For example, we have object navigator that allows us to search for specific objects and navigate through their collections or links to other objects.  The navigator form must know what properties on each object are from the DB so that it can show them in the results grid but the user could search for any number of different objects so we need to be able to use reflection to get the list of properties to show, but I don't want to show custom properties in the grid, just the properties that are linked to DB columns. 

I see that most of the properties have the DBDataType attribute, but I would like to see if there is another easier way.

Thanks,

Dan
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: 11-Jun-2008 at 8:17am

In Beta1, probably the best way to accomplish this would be to use EntityColumn.GetEntityColumns for the entity type.  Entity columns are auto-generated into the factory classes for the entity properties defined in the CSDL. 

In Beta2, we now have an EntityMetadataStore, and a much improved EntityMetadata class, which has getters for most of the interesting metadata you'd want to retrieve.

Beta2 should be available by the end of this week. (Hopefully I haven't jinxed it!)

 

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down