public virtual bool SoftRemove(T entity, bool isSave = true) { if (!(entity is Entity)) { throw new ArgumentException("T must be an Entity type that is derived from the Entity class in the namespace Com.Domain.Core."); } var aEntity = entity as Entity; aEntity.IsDeleted = true; EFContext.RegisterSoftDeleted(entity); return(isSave ? EFContext.Commit() > 0 : false); }
public virtual int SoftRemove(IEnumerable <T> entities, bool isSave = true) { foreach (T entity in entities) { if (!(entity is Entity)) { throw new ArgumentException("T must be an Entity type that is derived from the Entity class in the namespace Com.Domain.Core."); } var aEntity = entity as Entity; aEntity.IsDeleted = true; EFContext.RegisterSoftDeleted(entity); } return(isSave ? EFContext.Commit() : 0); }