Silverlight RIA存储过程-服务代码不';我不会被处决

Silverlight RIA存储过程-服务代码不';我不会被处决,silverlight,ria,domainservices,Silverlight,Ria,Domainservices,我在SQL Server中有一个自定义存储过程,我希望通过RIA服务执行该过程。我已经使用标量返回类型(int假设存储的proc返回行计数)完成了函数导入。我可以在ObjectContext中查看存储过程。我将存储的proc包装在RIA服务中,从Silverlight客户端调用。在本例中,客户端正在调用方法“ApproveOrRejectLeave”,但服务器端代码永远不会执行。我甚至尝试调用tmsService.SubmitChanges(),但在服务器端什么也没发生 我错过什么了吗 客户端:

我在SQL Server中有一个自定义存储过程,我希望通过RIA服务执行该过程。我已经使用标量返回类型(int假设存储的proc返回行计数)完成了函数导入。我可以在ObjectContext中查看存储过程。我将存储的proc包装在RIA服务中,从Silverlight客户端调用。在本例中,客户端正在调用方法“ApproveOrRejectLeave”,但服务器端代码永远不会执行。我甚至尝试调用tmsService.SubmitChanges(),但在服务器端什么也没发生

我错过什么了吗

客户端:

EmpDomainContext tmsService = new EmpDomainContext();
tmsService.ApproveOrRejectLeave(leaveRequest);
public void ApproveOrRejectLeave(LeaveRequestView current)
{
    ObjectResult result = this.ObjectContext.ApproveOrRejectLeave(current.EmpId, current.ReviewedByUserId, current.StatusId);
}
服务器端:

EmpDomainContext tmsService = new EmpDomainContext();
tmsService.ApproveOrRejectLeave(leaveRequest);
public void ApproveOrRejectLeave(LeaveRequestView current)
{
    ObjectResult result = this.ObjectContext.ApproveOrRejectLeave(current.EmpId, current.ReviewedByUserId, current.StatusId);
}
谢谢,
Rav

我找到了原因!!所需的只是一个[Invoke]属性。RIA服务根据EntityState(分别为修改、插入或删除)调用具有[Edit]、[Insert]和[Delete]属性的方法。由于我的方法没有特定的操作,并且是一个存储的过程调用,RIA无法找到任何“有效”EntityState,因此不调用此服务器方法。使用[Invoke]属性对其进行去编码成功了

[Invoke]
    public void ApproveOrRejectLeave(LeaveRequestView current) {     ObjectResult result = this.ObjectContext.ApproveOrRejectLeave(current.EmpId, current.ReviewedByUserId, current.StatusId); } 

我已经找到了原因!!所需的只是一个[Invoke]属性。RIA服务根据EntityState(分别为修改、插入或删除)调用具有[Edit]、[Insert]和[Delete]属性的方法。由于我的方法没有特定的操作,并且是一个存储的过程调用,RIA无法找到任何“有效”EntityState,因此不调用此服务器方法。使用[Invoke]属性对其进行去编码成功了

[Invoke]
    public void ApproveOrRejectLeave(LeaveRequestView current) {     ObjectResult result = this.ObjectContext.ApproveOrRejectLeave(current.EmpId, current.ReviewedByUserId, current.StatusId); }