如何在 WCF 服务契约接口实现中实现额外的非 wcf 服务契约接口

How to implement an additional non-wcf service contract interface in a WCF service contract interface implementation

我正在创建 WCF 服务:

[ServiceContract]
public interface IContractManagementServices
{    
    ...
}

我希望合约实现也实现另一个接口:

public interface ILogin
{
    bool GetLoginCredential(String LoginID, String Password);
}

例如:

public class ContractManagementServices : IContractManagementServices, ILogin
{
    ...
}

但是我收到一个错误。

试试这个代码

    private ILogin _businessLogic {get; set;}
    public Service()
    {
        if (_businessLogic == null) { _businessLogic = new Login(); }
    }

我想它会解决你的问题。