I want to define a class like this
[DataContract]
class MyClass
{
[DataMember]
List<TMyList<Tw here T : IMyList {get; set;}
}
or something like this. I don't want to put <Ton my class definition
because it is only after the instance has been created that I will
know exactly which type of object MyList will use. And I want the
DataContractSer ializer to serialize the object straightforward ly so I
want it to remain a Property rather than a method.
But I can't seem to declare it like this. I have tried a few
variations. Is there a solution that is simple or is it not possible?
thanks
Phil
[DataContract]
class MyClass
{
[DataMember]
List<TMyList<Tw here T : IMyList {get; set;}
}
or something like this. I don't want to put <Ton my class definition
because it is only after the instance has been created that I will
know exactly which type of object MyList will use. And I want the
DataContractSer ializer to serialize the object straightforward ly so I
want it to remain a Property rather than a method.
But I can't seem to declare it like this. I have tried a few
variations. Is there a solution that is simple or is it not possible?
thanks
Phil
Comment