Work with generic
I have a class look like this:
public class NamSetup: INameSetup
{
static List<Name> nbames= new List<Name>();
....
public List<Name> GetClients()
{
return names;
}
public List<Name> AddName(Name name)
{
names.Add(name);
return GetClients();
}
}
I just want to make another class with names: myName.cs Inside myName.cs and want to call the AddName methode above. Do you kn开发者_如何学Pythonow to to do it?
Thank you in advance
class MyName
{
public MyName()
{
NamSetup nm = new NamSetup();
nm.AddName(new Name());
}
}
精彩评论