Click here to Skip to main content
15,891,708 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

C#
[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>();
        }
    }
Posted
Updated 18-Jan-13 0:40am
v2

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900