I have a windows service where I create a list of objects and I want to pass this list to my windows service.
So first of all I have two classes Person and Persons. Person just describes the Person and Persons makes a list of Person objects. Then I want to pass this list to my wcf service but I get an error because I don't have a DataContract for this list. The two classes are in my windows service.
How can I give those classes DataContract and then pass the list?
I couldn't find anything about implementing external classes into an wcf service.
WindowsService
Person
public class Person()
{
public string Age{get; set;}
public string Path{get; set;}
public Person(string age, string path)
{
this.Age = age;
this.Path = path;
}
}
-Persons-
public class Persons()
{
private List<Person> personlist;
public Persons()
{
personlist = new List<Person>();
}
}
WCFService
WindowsServiceMethod wsm = new WindowsServiceMethod(); //Just imagine a method in my windows service
public List<Person> GetPerson(string path)
{
List<Person> personlist = wsm.GetProjects(path);
}