Tag: 合同

WCF – 使用相同数据协定的多个服务合同

我有一个关于WCF大师的新问题。 所以,我有一个类User ,它接近我用于数据库操作的DB的’User’表示。 现在,我想有两个不同的服务合同,使用这个类作为数据合同,但每个都以他们自己的方式……我的意思是, public class DBLayer { void InsertUsers(List userList) { // both ‘PropertyVisibleForService1’ and ‘PropertyVisibleForService2’ // are used HERE to be inserted into their columns } } [DataContract] public class User { [DataMember] public string PropertyVisibleOnlyForService1{…} [DataMember] public string PropertyVisibleOnlyForService2{…} } [ServiceContract] public interface IService1 { List GetUsers(); // user with ‘PropertyVisibleOnlyForService1’ inside […]