Skip to content

Commit

Permalink
Merge branch 'feat/id_long' of github.com:anjoy8/Blog.Core into feat/…
Browse files Browse the repository at this point in the history
…id_long
  • Loading branch information
LemonNoCry committed Apr 1, 2023
2 parents f785d50 + 3c0d9f9 commit 18861bc
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions Blog.Core.IServices/BASE/IBaseServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public interface IBaseServices<TEntity> where TEntity : class
Task<bool> DeleteByIds(object[] ids);

Task<bool> Update(TEntity model);
Task<bool> Update(List<TEntity> model);
Task<bool> Update(TEntity entity, string where);

Task<bool> Update(object operateAnonymousObjects);
Expand Down
9 changes: 9 additions & 0 deletions Blog.Core.Repository/BASE/BaseRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,15 @@ public async Task<bool> Update(TEntity entity)
//这种方式会以主键为条件
return await _db.Updateable(entity).ExecuteCommandHasChangeAsync();
}
/// <summary>
/// 更新实体数据
/// </summary>
/// <param name="entity">博文实体类</param>
/// <returns></returns>
public async Task<bool> Update(List<TEntity> entity)
{
return await _db.Updateable(entity).ExecuteCommandHasChangeAsync();
}

public async Task<bool> Update(TEntity entity, string where)
{
Expand Down
6 changes: 6 additions & 0 deletions Blog.Core.Repository/BASE/IBaseRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ public interface IBaseRepository<TEntity> where TEntity : class
/// <param name="model"></param>
/// <returns></returns>
Task<bool> Update(TEntity model);
/// <summary>
/// 更新model
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
Task<bool> Update(List<TEntity> model);

/// <summary>
/// 根据model,更新,带where条件
Expand Down
9 changes: 9 additions & 0 deletions Blog.Core.Services/BASE/BaseServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ public async Task<bool> Update(TEntity entity)
{
return await BaseDal.Update(entity);
}
/// <summary>
/// 更新实体数据
/// </summary>
/// <param name="entity">博文实体类</param>
/// <returns></returns>
public async Task<bool> Update(List<TEntity> entity)
{
return await BaseDal.Update(entity);
}

public async Task<bool> Update(TEntity entity, string where)
{
Expand Down

0 comments on commit 18861bc

Please sign in to comment.