I have
public interface IPersistedModel<TModel, TIdentifier>
I'd like to define an interface where I have a generic method that uses the generic type parameters from the above. Is there a way to do this? I've tried the following but neither compiles.
public interface IModelCollection1<IPersistedModel<TModel, TIdentifier>>
{
IEnumerable<TModel> ReadCollection(TIdentifier identifier);
}
or
public interface IModelCollection2<T> where T : IPersistedModel<TModel, TIdentifier>
{
IEnumerable<TModel> ReadCollection(TIdentifier identifier);
}