Step: 1I have a class Mytest
class MyTest
{
public string Name { get; set; }
}
Step2: Created a class Demo to use the member variables of the class myTest
class Demo
{
public void GetNames<T>(IList<myTest> info)
{
foreach (myTest test in info)
{
Console.WriteLine(test.Name.ToString());
}
}
}
Now my question is:
How can call the method GetNames in the main method(C#.net console application) .my requirement is very simple.I just want to access the values of myTest class using the method GetNames and print the value in the main method.Please help me on this.
class Program
{
static void Main(string[] args)
{
//code to call the method Getnames and print the value of name here..
}
}