建完一个Silverlight+riaservice项目之后,在web端的domainservice类只会产生如下代码:
public void UpdateAbsentRecord(AbsentRecord currentAbsentRecord)
{
this.Context.AttachAsModified(currentAbsentRecord, this.ChangeSet.GetOriginal(currentAbsentRecord));
}
类似于这种的类的修改方法,不知在客户端是如何调用到的,怎么也试不出如何使用,请大家帮帮忙!
因为不是用DataGrid直接进行修改,我是从数据库拿到一个类,对类修改后,
HRMSDomainContext domainContext = new HRMSDomainContext();
domainContext.SubmitChanges();
无法修改到数据库。
((IEditableObject)newEmployee).BeginEdit();
newEmployee.Age = 60;
((IEditableObject)newEmployee).EndEdit();
domainContext.SubmitChanges();
也是一样,只能改到类的数据,无法保存到数据库。
现在只是用了
domainContext.Employees.Add(theEmployee);
domainContext.Employees.Remove(theEmployee);
对表进行增加和删除,对于[update]属性的定义还不会使用,riaoverview中也没提到
本人是新手,请大家不吝赐教。谢谢大家了。