I'm not sure how to go about this...
I have a class that performs various functions:
public abstract class EntityBase { ... }
public interface ISomeInterface<T> where T : EntityBase, new() { ... }
public class SomeClass<T> : ISomeInterface<T> { ... }
I'm trying to have a cache of these in a non-generic class:
public class MyClass
{
//Not sure how to do this
private ConcurrentDictionary<?, ISomeInterface<?>> Cache { get; set; }
}
The problem is that EntityBase is abstract and can not do new(), The ISomeInterface expects a class that is based off EntityBase and does new(). Is there any way to do what I'm wanting to do?
Update: I realized that for the TKey I can use Type, but I still am not sure what to put for the ISomeInterface.