开发者

RIA Custom Update method

Given my RIA Service:

[Update]
public void Update(Car car)
{
   _carRepository开发者_开发知识库.Update(car);
}

[Update(UsingCustomMethod = true)]
public void UpdateAndClone(Car car)
{
   _carRepository.UpdateAndClone(car);
}

How may I "map" SubmitChanges to my Custom update method from my Silverlight client side?

Public void Save(Action<SubmitOperation> submitCallback, object state)
{
  _carContext.SubmitChanges(submitCallback, state);
}

Public void SaveAndClone(Action<SubmitOperation> submitCallback, object state)
{
  _carContext.SubmitChanges(submitCallback, state);
  // _carContext.UpdateAndClone(????)
}

I would like my application to handle the update in two quite different ways according to which action is peformed by the user, but I'm having trouble to understand how my "custom" update should be used.


It seems that I can't have both a "standard" update and a custom update. So by calling the custom method in the viewmodel before doing .SubmitChanges() solves this issue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜