0
votes

I have create a simple user login WCF Services.I have using large number of datamember properties in one datacontract class.so i have split the datamember properties in different class. for example (Userdetails class with using userid,usertype,username,password,address,city,state,phoneno,mobileno,country,pincode,etc...)so i have split on the two Datacontract classes into userdetails as Userinfo and contactdetails class.The userinfo class only define the userdetails only and contactdetails class defined contact details as. how to use on the multiple datacontact class in WCF services can you please explain them.

1

1 Answers

0
votes

I'm not sure what exactly you want. but i hope you could use something like this:

[DataContract]
public class User
{
    [DataMember]
    public userdetails Userinfo { set; get; }
    [DataMember]
    public contactdetails contactdetails { set; get; }
}
[DataContract]
public class userdetails
{
    [DataMember]
    public long userid { set; get; }
    [DataMember]
    public string usertype { set; get; }
}
[DataContract]
public class contactdetails
{
    [DataMember]
    public long mobileNumber { set; get; }
    [DataMember]
    public string phoneNumber { set; get; }
}