Here is my interface.
public interface IFoo
{
TOut Process<TOut, TIn>(SomeClass<TOut, TIn> container)
where TOut : class,
where TIn : class;
}
I would like to achieve following results:
public class Foo<TIn> : IFoo
where TIn : class
{
public ConcreteOutType ConcreteOut { get; set; } = new();
public ConcreteOutType Process<ConcreteOutType, TIn>(SomeClass<ConcreteOutType, TIn> container)
=> ConcreteOut;
}
My class does not implement interface. Is it even possible to swap generic type with concrete type in my implementation and respect interface method signature?
Process-function doesn't really do anything with the providedcontainer, so it's hard to indicate what it's supposed to do and how the generic argument should be used.