Hi I have two classes
public class JobDataProvider
{
public List<Job> Get(int id){
List<Job> jobs = new List<Job>();
foreach(up_GetJobResult result in myDataContext.up_GetJob(id))
{
jobs.add(new Job(Id = result.Id, name = result.Name));
}
return jobs;
}
}//end class Job
public class PersondataProvider{
public List<Person> Get(int id){
List<Person> persons = new List<Persons>();
foreach(up_GetPersonsResult result in MyDataContext.up_GetPerson(id)){
persons.add(new Person(Id = result.Id, Name = result.Name, Surname = result.Surname));
}
return persons;
}
}end class Person
i want to create a generic method, something like this
public List<T> Get<T>(int id)
{
.. get data and return the list
}