this is a case where you need to use contravariance in the
public delegate void MapFunc<in V>(Iapi i, V doc);
If I understand this correctly,
this says that the
can take any type that is
or derived from
Disclaimer: I haven't needed to use this in anything I've written.