gpt4 book ai didi

WCF RIA 服务自定义方法?

转载 作者:行者123 更新时间:2023-12-03 23:27:19 27 4
gpt4 key购买 nike

WCF RIA 服务是否支持自定义方法?我还能在哪个 dll 中找到“[Custom]”属性?

最佳答案

是的,WCF RIA 服务可以支持自定义方法。

您将使用 [Invoke] 属性指定装饰您的自定义方法。例如:

[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.
}
});

关于WCF RIA 服务自定义方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2414858/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com