摆脱WCF DataContract中不需要的标签

时间:2018-09-17 12:29:39

标签: wcf datacontract

在以下wsdl模式中,我想删除EmpPersonalInfo标签,并通过EmpPersonalInfo重命名不需要的标签 sample wsdl 这是我的datacontarct类

[CollectionDataContract(ItemName = "PayDetailsRec")]
public class PayDetailList : List<paydet>
{ }

public class paydet
{
    [CollectionDataContract(ItemName = "unwanted")]
    public class EmpPersonalInfoList : List<persdet>
    { 
    }

    public EmpPersonalInfoList EmpPersonalInfo { get; set; }

    public class persdet
    {
        public string FullNameEn { get; set; }
        public string FullNameAr { get; set; }
    }
}

[DataMember(Name = "PayDetailsRecs")]
public PayrollDetailList PayrollDetails { get; set; }

将不胜感激

0 个答案:

没有答案