using System.Threading.Tasks;
using System.Collections.Generic;
public static void Main()
var c = new MyContainer<MyEnum>();
c.MyProp = new SomeClass<MyEnum, MyImplementation>();
public interface ISomeClass<TEnum, out S>
public interface IMyInterface
public class SomeClass<TEnum, S> : ISomeClass<TEnum, S> where TEnum : struct, IConvertible where S : IMyInterface
public IEnumerable<S> Inc
public class MyImplementation : IMyInterface
public class MyContainer<TEnum>
where TEnum : struct, IConvertible
public SomeClass<TEnum, IMyInterface> MyProp