views:

25

answers:

1

How can one modify DomainService code without the custom code being overwritten?

Is there a way to put the custom code in a seperate class file?

Thanks.

A: 

Are you talking about the insert/update/delete generated code? You are supposed to modify and expand this code for your specific needs. View this code as a suggested starting point on which to build your custom functionality.

If you are talking about the classes generated by the data model, then consider expanding the partial classes with metadata: http://www.nikhilk.net/RIA-Services-Fluent-Metadata-API.aspx

For a more detailed sample, see the Book Club RIA Services Application tutorial (code and videos) by Nikhil Kothari.

Peet Brits
No, I'm referring to the Get methods of the DomainService. I have associations set up within the Entity Model, but the DomainService is agnostic of those relationships. Therefore, I have to decorate the Property within the "ugly buddy" class of the DomainServices metadata with an "Include" attribute. The Fluent API may work, but I feel that the DomainService missed the bar when it comes to extensibility, hopefully v-next will resolve the extensibility limitations. EF is a great example of an extensible framework (because it generates partial classes from the get-go).
Moderator71