New Posts New Posts RSS Feed: Navigational Properties MetaData
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Navigational Properties MetaData

 Post Reply Post Reply
Author
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Topic: Navigational Properties MetaData
    Posted: 25-Jan-2012 at 12:56pm
Thanks, I retested, and it seems to be working OK now.

Greg
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 24-Jan-2012 at 7:24pm
Hi Greg;

What version are you using?

I just tested this using the latest 6.1.5 and it works for both scalar and non-scalar navigation property. I can see the generated code incorporated the new DisplayAttribute.
Back to Top
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Posted: 24-Jan-2012 at 8:59am
I have an Entity Class "Customer". I then create a metadata buddy class for Customer and use the MetaDataAttribute to connect the two.

I can then decorate the properties of the metadata class, and they are incorporated into the generated code as expected.

However, if I decorate a Navigational Property, the attributes are NOT incorporated into the generated code.

It appears that the code which transfers the attributes from the metadata class to the generated class skips Navigational properties.

Now, the question you may be thinking, why would anyone want to decorate a navigational property. The reason is that I need to set Display(AutogenerateField = true) for the property. This is used at runtime to create a data grid. There are other custom attributes used as well on the property to help generate the grid.

But I need the navigational property to be properly decorated for this to work.

Greg
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down