Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
        public void  FindByIdAndDelete(Guid addId)
        {
            var result = this.adds.All.FirstOrDefault(x => x.Id == addId);

            result.IsDeleted = true;
            context.Commit();
        }
Exemplo n.º 3
0
 public bool BatchInsert(List <SysRoleMenu> entities)
 {
     entities.ForEach(item => { GetSet().Add(item); });
     return(_unitOfWork.Commit() != 0);
 }