I tried to use type parameter to call static method but got compile error
'T' is a 'type parameter', which is not valid in the given context.
Why this is not allowed ?
Should I really use a lot longer ModelGenericBas e<T>.test1() ?
Andrus.
class VirtualGrid<T>
where T : ModelGenericBas e<T{
void test() {
//'T' is a 'type parameter', which is not valid in the given context
T.test1();
}
}
class ModelGenericBas e<T{
public static void test1() {
}
}
'T' is a 'type parameter', which is not valid in the given context.
Why this is not allowed ?
Should I really use a lot longer ModelGenericBas e<T>.test1() ?
Andrus.
class VirtualGrid<T>
where T : ModelGenericBas e<T{
void test() {
//'T' is a 'type parameter', which is not valid in the given context
T.test1();
}
}
class ModelGenericBas e<T{
public static void test1() {
}
}
Comment