Last post Jan 01, 2009 12:09 PM by sjnaughton
Jan 01, 2009 07:59 AM|mchatter|LINK
Is it possible to extend the EF Data Model with custom properties for use with Dynamic Data and if so how ?
Happy New Year All !
Jan 01, 2009 08:11 AM|sjnaughton|LINK
You can add your own custom properties to EF but the EntityDataSource does not supoport them at this time so DD will not see them sorry [:(]
Jan 01, 2009 08:27 AM|mchatter|LINK
That's the answer I wasn't hoping to get !!!
I need a way to show a calculated field in a DynamicData EF. Apart from a custom FieldTemplate is there any other way to achieve this ?
Jan 01, 2009 09:30 AM|sjnaughton|LINK
No I've had to use custom FieldTemplates in EF to do this. But I ususally end up going back to L2S st everything is som much easyer. You would'nt think the same company wrote them would you? I just wish EF lived up to Linq to SQL [:D] maybe in the next release
Linq to SQL
Jan 01, 2009 09:52 AM|mchatter|LINK
Do you have know of any examples of FieldTemplates that access values of a related entity ? For example if I design a field template for the Order entity I'd like to access properties of the Customer entity from it. (I can currently get Order properties
using GetColumn & GetColumnValues)
Jan 01, 2009 10:30 AM|sjnaughton|LINK
You would cast the Row property (in OnDatabinding) to the entity for your custome FieldTemplate and then you can access all it's members and associations but remember that you need to implicily load any related tables Like Order.CustomerReference.Load()
David Ebbo mentioned in your other thread [:D]
Jan 01, 2009 11:38 AM|mchatter|LINK
I could'nt do a simple cast of the Row object but after some digging I found an article
http://blogs.msdn.com/diego/archive/2008/05/13/entitydatasource-to-wrap-or-not-to-wrap.aspx that allows me to extract the entity.
Thanks once again, Steve.
Jan 01, 2009 12:09 PM|sjnaughton|LINK
Ah yes I do remember David mentioning that in a recent post [:$]