I am creating a web service to fetch the employee data. I am using EF 4.0 and have created a serializable employeewrapper class accessible in webservice.
I need help in serializing the foreign key relationship classes to access the related data as well.
How to make Designation and Client serializable?
Currently my code is:
[Serializable]
public class EmployeeWrapper
{
public string FirstName { get; set; }
public string MiddleName { get; set; }
public short DesignationId { get; set; }
public virtual Designation Designation { get; set; }
public virtual ICollection<Client> Client { get; set; }
public EmployeeWrapper()
{
this.Client = new HashSet<Client>();
}
}