📜  没有从“xxxx.Database.Domain.Entities.Order”到“System.IDisposable”的隐式引用转换 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:23.795000             🧑  作者: Mango

代码示例1
Current definition requires TEntity (i.e. Person) to be disposable (you have put IDisposable to constraints of generic type)

public class UnitOfWork where TEntity : class, IDisposable
But I think you want object to be disposable, and entity to be of reference type. So, change definition to

public class UnitOfWork : IDisposable
    where TEntity : class