Ejemplo n.º 1
0
 /// <summary>
 /// 删除数据实体集合
 /// </summary>
 /// <param name="entities">数据实体集合</param>
 /// <param name="saveChange">是否执行删除</param>
 /// <returns></returns>
 public virtual int Delete(IEnumerable <TEntity> entities, bool saveChange = true)
 {
     ArgumentUtil.ThrowIfNull(entities, nameof(entities));
     //
     WorkContext.RegisterDeleted(entities);
     return(saveChange ? WorkContext.Commit() : 0);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 删除单个数据实体
 /// </summary>
 /// <param name="entity">数据实体</param>
 /// <param name="saveChange">是否执行删除</param>
 /// <returns></returns>
 public virtual int Delete(TEntity entity, bool saveChange = true)
 {
     ArgumentUtil.ThrowIfNull(entity, nameof(entity));
     //
     WorkContext.RegisterDeleted(entity);
     return(saveChange ? WorkContext.Commit() : 0);
 }