我在OperationContract中使用接口作为输入参数。但是当我在客户端生成代理类时,我无法访问接口或实现ITransaction接口的类的成员。我只能得到对象。
Service Interface
[ServiceContract] public interface IServiceInterface { [OperationContract] string SyncDatabase(ITransaction TransactionObject); }
Service class
class SyncService:IServiceInterface { public string SyncDatabase(ITransaction TransactionObject) { return "Hello There!!"; } }
Interface
public interface ITransaction { ExpenseData ExpData { get; set; } void Add(ITransaction transactionObject); }
Data Contract
[DataContract] public class Transaction:ITransaction { [DataMember] public ExpenseData ExpData { get; set; } public void Add(ITransaction transactionObject) { } }