我是 WCF 的新手。我正在寻找多个回调合同的出路,可能或不像下面
[ServiceContract (
CallbackContract = typeof (CallbackContract_1),
CallbackContract = typeof (CallbackContract_2),
CallbackContract = typeof (CallbackContract_3))
]
public interface SomeWcfContract {}
我正在搜索谷歌并找到了出路,就像
interface ICallbackContract1
{...}
interface ICallbackContract2 : ICallbackContract1
{...}
[ServiceContract(CallbackContract = typeof(ICallbackContract1))]
interface IMyBaseContract
{...}
[ServiceContract(CallbackContract = typeof(ICallbackContract2))]
interface IMySubContract : IMyBaseContract
{...}
or
interface ICallbackContract1
{...}
interface ICallbackContract2
{...}
interface ICallbackContract3 : ICallbackContract2,ICallbackContract1
{...}
[ServiceContract(CallbackContract = typeof(ICallbackContract1))]
interface IMyBaseContract1
{...}
[ServiceContract(CallbackContract = typeof(ICallbackContract2))]
interface IMyBaseContract2
{...}
[ServiceContract(CallbackContract = typeof(ICallbackContract3))]
interface IMySubContract : IMyBaseContract1,IMyBaseContract2
{...}
我只需要知道多重回调合同是否有其他出路。谢谢