Hi all,
Could you answer me how to do next, please? How to do this with Lambda? Is it possible to delegate some object instance and use its properties and methods in case if this method doesn't know type of delegated object?
class class_a {
public string getChildData<T> (T dynamicInstance) {
return dynamicInstance.prop;
}
}
class class_b : a {
public string prop = "prop_b";
}
class class_c : a {
public string prop = "prop_c";
}
var inst_b = new b ();
var inst_c = new c ();
b.getChildData(b);
c.getChildData(c);
Purpose : to get child property inside parent class?
Thanks, Artem