是的WCF RIA服务可以支持自定义方法.
您可以使用[Invoke]属性指定装饰自定义方法.例如:
[EnableClientAccess()]
public class TestDomainService : LinqToEntitiesDomainService<TestEntities>
{
[Invoke]
public Test CustomMethodFetch(Guid testId)
{
...
return foundTest;
}
}
Run Code Online (Sandbox Code Playgroud)
..你会用它来称呼它...
var ctx = new TestDomainContext();
ctx.CustomMethodFetch( testId, (op) =>
{
if (op.HasError)
// Handle errors.
else
{
var testEntity = op.Value;
// Do stuff.
}
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
926 次 |
| 最近记录: |