我有一个类中的方法:
member this.GetDbSet<'TEntity, 'TDTO, 'TKey when 'TKey :> IEquatable<'TKey> and 'TEntity :> IEntity<'TKey> and 'TEntity : not struct and 'TDTO :> IDTO<'TKey> and 'TEntity : equality and 'TEntity : null and 'TDTO : equality and 'TDTO : null and 'TKey : equality>(repository : BaseRepository<'TEntity, 'TDTO, 'TKey>) =
repository.DbSetFuncGetter().Invoke(uow.Context())
但是在构建项目时,我遇到了这个错误。
This code is not sufficiently generic. The type variable 'TEntity when 'TEntity :> IEntity<'TKey> and 'TEntity : not struct and 'TEntity : equality and 'TEntity : null and 'TKey :> IEquatable<'TKey> and 'TKey : equality could not be generalized because it would escape its scope.
但是所有的限制条件都在那里。我有什么遗漏的吗?
编辑:
如果您需要更多的代码:
这是一个开源项目。