I don't understand what am I doing wrong when trying to access members of class from generic type T. I also specifically used WHERE constraint. I get the following message: 'T' is a type parameter, which is not valid in the current context.
class Test
{
public static int id = 1;
public int GetId()
{
return id;
}
}
public class TestUsage
{
public int IncrementId<T>() where T : Test
{
return 1 + T.GetId();
}
}