The execution of the following code yields error :No overloads of ProcessPerson Matches ThreadStart.
public class Test
{
static void Main()
{
Person p = new Person();
p.Id = "cs0001";
p.Name = "William";
Thread th = new Thread(new ThreadStart(ProcessPerson));
th.Start(p);
}
static void ProcessPerson(Person p)
{
Console.WriteLine("Id :{0},Name :{1}", p.Id, p.Name);
}
}
public class Person
{
public string Id
{
get;
set;
}
public string Name
{
get;
set;
}
}
How to fix it?