The problem is that your method does not determine the generic type <T>. It just uses the type Tspecified by the enclosing type.
And you can only declare restrictions in the same place where you define the general parameters .
:
1.. :
public class EnclosingType
{
internal IDictionary<string, T> FillObjects<T>(
IReadableRange<T> svc,
Func<T, string> getKey) where T : BaseEntity
{
}
}
, EnclosingType, , EnclosingType<T>, EnclosingType's T FillObjects' T:
2.. :
public class EnclosingType<T>
where T : BaseEntity
{
internal IDictionary<string, T> FillObjects(
IReadableRange<T> svc,
Func<T, string> getKey)
{
}
}