
[DataContract]public class OrderSyncdata : isync{ public OrderSyncdata(Order o) { this.CurrentOrderStatus = o.DriverStatus; this.StatusDescription = o.StatusDescription; SyncTimestamp = o.SyncTimestamp; ???? } [DataMember] public string CurrentOrderStatus { get; set; } [DataMember] public string StatusDescription { get; set; } [DataMember]// I don't think I need these any more public bool IsCanceled { get; set; } [DataMember] public bool IsResolved { get; set; } [DataMember] public bool IsPendingResponse { get; set; } DateTime isync.SyncTimestamp { get; set; }} 如何设置isync.SyncTimestamp的值?我试着施放“这个”.但它不起作用
解决方法 这应该工作:((isync)this).SyncTimestamp = o.SyncTimestamp;
注意额外的括号(isync).
总结以上是内存溢出为你收集整理的c# – 如何在构造函数中设置属性值(显式接口实现)全部内容,希望文章能够帮你解决c# – 如何在构造函数中设置属性值(显式接口实现)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)