Search code examples
wcf-ria-servicessilverlight-5.0

A complete and simple example of a Named Update Operation


Can anyone give me a link to a complete example of a Named Update?


Solution

  • I don't know where to look for a named update, however it's pretty straightforward:

    • Create a method on your DomainService (says it's named MyCustUpdate)that return void and accept on input an instance of your entity (says it's named MyEntity)and, eventually, other parameters (primitives like int, string etc)
    • Decore this method with [Update(UsingCustomMethod = true)]
    • Client side, on the generated entity MyEntity you'll find the method MyCustUpdate; just call it and when you're done with your edits, call DomainContext.SubmitChanges

    Your custom update method will be called as part of your SubmitChanges call server side