BaseDal 中对实体进行软删除
public class BaseDal<T> where T:class,new() { public DbContext Db { get { return DbContextFactory.GetCurrentDbContext(); } } public bool Delete(T Entity) { Db.Entry(Entity).Property("DelFlag").CurrentValue = true; Db.Entry(Entity).Property("DelFlag").IsModified = true; return Db.SaveChanges() > 0; } }