Skip to content

Commit

Permalink
新增返回实体
Browse files Browse the repository at this point in the history
  • Loading branch information
panda-big committed Jan 9, 2020
1 parent 5bf04f9 commit f7d4cd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/UnitOfWork/IRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ Task<IList<TEntity>> GetAllAsync(Expression<Func<TEntity, bool>> predicate = nul
/// Inserts a new entity synchronously.
/// </summary>
/// <param name="entity">The entity to insert.</param>
void Insert(TEntity entity);
TEntity Insert(TEntity entity);

/// <summary>
/// Inserts a range of entities synchronously.
Expand Down
4 changes: 2 additions & 2 deletions src/UnitOfWork/Repository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,9 @@ public bool Exists(Expression<Func<TEntity, bool>> predicate = null)
/// Inserts a new entity synchronously.
/// </summary>
/// <param name="entity">The entity to insert.</param>
public virtual void Insert(TEntity entity)
public virtual TEntity Insert(TEntity entity)
{
var entry = _dbSet.Add(entity);
return _dbSet.Add(entity).Entity;
}

/// <summary>
Expand Down

0 comments on commit f7d4cd1

Please sign in to comment.