public override TEntity Insert(TEntity entity) { try { GetSet().Add(entity); return(_unitOfWork.Commit() <= 0 ? null : entity); } catch (Exception e) { throw new Exception("ef core add error:" + e.Message); } }
public void FindByIdAndDelete(Guid addId) { var result = this.adds.All.FirstOrDefault(x => x.Id == addId); result.IsDeleted = true; context.Commit(); }
public bool BatchInsert(List <SysRoleMenu> entities) { entities.ForEach(item => { GetSet().Add(item); }); return(_unitOfWork.Commit() != 0); }