, . ? , ? , , , , , , . , - , , .
, (), , .
class Wrapper<G> where G: SomeType
{
public G Base;
public Wrapper(G g) {
Base = g;
}
}
where, , , .
, , , , , , : . , , . , , MyWrapper.Base , , . , , , , ...
If you want to create a new object that extends something, and in some transparent way copies the properties of an existing object, then do something like this:
class Wrapper<G>: G
{
public Wrapper(G g) {
}
.. more properties
}
Wrapper<SomeType> newWrapper = Wrapper<SomeType>(someOtherObject);
.. like how you can create a new List from an existing one.