1

wcf ria 域服务方法似乎不可能有一个抽象类的返回类型。我无法找到任何表明它是不允许的引用,但是我具有抽象类类型参数(输入或输出)的任何方法在相应客户端项目的生成代码中都不可用。

是否有一种解决方法可以使 Silverlight 客户端可以使用方法 QryAddressByAddressId 在域服务中调用?

[EnableClientAccess()]
public class AddressQuerySvcDomainSvc : DomainService
{
    public AddressBase QryAddressByAddressId(string sAddressId)
    {
        ... 
    }
}


[DataContract()]
[KnownType(typeof(NumberedAddress))]
[KnownType(typeof(IntersectionAddress))]
public abstract class AddressBase
{
    ...
}

[DataContract()]
public partial class NumberedAddress : AddressBase
{
    ...
}

[DataContract()]
public partial class IntersectionAddress : AddressBase
{
    ...
}
4

1 回答 1

0

Your query methods must conform to the naming convention, use an attribute, or both.

 public AddressBase QueryAddressByAddressID(...)

or

public AddressBase GetAddressByAddressID(...)

or

[Query]
public AddressBase QryAddressByAddressID(...)
于 2012-07-13T14:31:02.937 回答