Is there any way to do something like this?
public interface ISomething
{
}
public class SomethingThatImplementsISomething: ISomething
{
}
public class SomethingElse
{
public ICollection<ISomething> PropertyName{ get; set; }
}
I’ve tried it out, and it keeps failing. Any ideas?
ICollection<Models.Awardable>can not be converted toICollection<IAwardable>.What would happen if someone tried to add an
IAwardableto the collection that wasn’t aModels.Awardable?Just instantiate a collection of
IAwardableand add instances ofModels.Awardableto it.