hi all, i have a problem regarding data contract in my application. i have 5 tables in my database and i required 3 of them as datatype. so i created a class and decleared all required table as class under [datacontract] here's the code
[DataContract] public class CustomerDetail { [DataMember] public int CustomerID { get; set; } [DataMember] public string CustomerName { get; set; } [DataMember] public long ContactNumber { get; set; } [DataMember] public string Email { get; set; } [DataMember] public string Address { get; set; } [DataMember] public string Password { get; set; } }
[DataContract(Name = "CustomerDetail")]
public class CustomerAccount
{
[DataMember]
public int AccountId { get; set; }
[DataMember ]
public short PinNo { get; set; }
[DataMember (Name="CustomerID")]
public int CustomerID { get; set; }
[DataMember]
public int AccountTypeId { get; set; }
[DataMember]
public float Amount { get; set; }
}
[DataContract(Name = "CustomerDetail")]
public class TransactionDetail
{
[DataMember]
public int TransactionId { get; set; }
[DataMember (Name ="CustomerID")]
public int CustomerId { get; set; }
[DataMember]
public int AccountId { get; set; }
[DataMember]
public int TransactiopnTypeId { get; set; }
[DataMember]
public float AmountAfterTransaction { get; set; }
}
i hv used attributes too, but i am getting invalid data contract exception.. plz help me out what i should to solve this.