Genreics
C#
1
Posts
1
Posters
0
Views
1
Watching
-
Hej i am writing a abstract class with a method that takes an expression parameter to point to a field.... The field it self is not present in this base class so the the expression needs to use the subclass so i need to have that type present in the method definition and the current way i am doing this is..
abstract class foo<SubClass>
{
public void bar(Expression <Func<SubClass , object >> Expression);
}As you see i need to pass in the subclass type from the subclass to the base class witch is not ideal since i am not going to be writing the subclass so my question is how can i use the type of the subclass without passing it as a parameter. Thanks for answers in advance .. Patrik