Example #1
0
 public override TEntity Update(TEntity entity)
 {
     try
     {
         _unitOfWork.SetModify <TEntity, TPrimaryKey>(entity);
         return(_unitOfWork.Commit() <= 0 ? null : entity);
     }
     catch (Exception e)
     {
         throw new Exception("ef core modify error:" + e.Message);
     }
 }
Example #2
0
 /// <summary>
 /// 更改实体
 /// </summary>
 /// <param name="item"></param>
 public override void Modify(TEntity item)
 {
     EfUnitOfWork.SetModify(item, DbMode.Write);
 }