I was wondering if this code could be improved. The IProvider implements IProvider and overwrites Request(…). I’d like to combine these into a single interface. But I still need a typed and untyped interface to work with.
Is there a way to combine these where I get both or is this how the interfaces should look?
public interface IProvider
{
DataSourceDescriptor DataSource { get; set; }
IConfiguration Configuration { get; set; }
IResult Request(IQuery request);
}
public interface IProvider<T> : IProvider
{
new IResult<T> Request(IQuery request);
}
If the generic type parameter
Tis only relevant in the context of theRequestmethod, declare only that method as generic: