views:

384

answers:

1

When using DataLoadOptions.LoadWith with ria services hooked up to a linq to sql model do i always have to specify the [Include] attribute in the entitys metadata class for relationships? I currently dont use metadata for my entities and if theres a way to achieve this without i would be grateful to know.

+2  A: 

You do need to have the [Include] attribute on the entity's metadata so that RIA Services knows to serialize the related entities and send them to the client. Without this, RIA Services could end up traversing lazily loaded properties that you don't want it to include.

Jeff Handley
@jeff handley - is this true for Entity Framework also or just LINQ to SQL used with RIA?
Simon_Weaver
It's true EF, LinqToSQL, or any other DAL.
Jeff Handley