Emitting a Generic Type that has a Generic Base Class

G

Guest

Hey... I dont know if its possible but i'm trying to emit a class that would
look like this

The Base class commes from the code:

public class BaseClass<T>
{
// Whatever implementation...
}

I want to generate a child class that looks like this:

public class ChildClass<T> : BaseClass<T>
{
}

so i want to define ChildClass<> not ChildClass<int> or ChildClass<object>
....is it possible?
 
B

Barry Kelly

Patrick said:
Hey... I dont know if its possible but i'm trying to emit a class that would
look like this

By emit, do you mean System.Reflection.Emit, or do you simply mean
compiled C# code?
The Base class commes from the code:

public class BaseClass<T>
{
// Whatever implementation...
}

I want to generate a child class that looks like this:

public class ChildClass<T> : BaseClass<T>
{
}

This descendant is perfectly possible and legal currently. It's the
so i want to define ChildClass<> not ChildClass<int> or ChildClass<object>
...is it possible?

What does 'ChildClass<>' mean?

-- Barry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top