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