2
WCF RIA服务是否支持自定义方法? 也在哪个DLL我可以找到“[Custom]”属性?WCF RIA服务的自定义方法?
WCF RIA服务是否支持自定义方法? 也在哪个DLL我可以找到“[Custom]”属性?WCF RIA服务的自定义方法?
是WCF RIA服务可以支持自定义方法。
您将指定使用[Invoke]属性修饰您的自定义方法。 EG:
[EnableClientAccess()]
public class TestDomainService : LinqToEntitiesDomainService<TestEntities>
{
[Invoke]
public Test CustomMethodFetch(Guid testId)
{
...
return foundTest;
}
}
..你会被称之为...
var ctx = new TestDomainContext();
ctx.CustomMethodFetch(testId, (op) =>
{
if (op.HasError)
// Handle errors.
else
{
var testEntity = op.Value;
// Do stuff.
}
});
请注明答案。 – Shimmy 2011-05-12 22:28:59