A
Axel Dahmen
Hi,
I've created a generic class having a type argument where I want to use
classes that have a parameterized constructor. I'm calling these constructors
from within the generic class.
Unfortunately I can't use this construct as the C# compiler requires me to
use the new() constraint, but the classes I'm using for the type argument
actually *don't* have a parameterless constructor. They just contain a
constructor having parameters.
Can someone please enlightening me on how to get this to work in C# without
having to implement useless (and invalid) parameterless constructors?
TIA,
Axel Dahmen
I've created a generic class having a type argument where I want to use
classes that have a parameterized constructor. I'm calling these constructors
from within the generic class.
Unfortunately I can't use this construct as the C# compiler requires me to
use the new() constraint, but the classes I'm using for the type argument
actually *don't* have a parameterless constructor. They just contain a
constructor having parameters.
Can someone please enlightening me on how to get this to work in C# without
having to implement useless (and invalid) parameterless constructors?
TIA,
Axel Dahmen