Skip to content

Commit

Permalink
修改注释;
Browse files Browse the repository at this point in the history
  • Loading branch information
zqlovejyc committed Apr 3, 2022
1 parent 65ee9f7 commit fca79b1
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions SQLBuilder/Repositories/BaseRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1971,12 +1971,20 @@ public virtual int Insert<T>(T entity) where T : class
}

/// <summary>
/// 插入单个实体
/// 插入单个实体 <para>注意:因为Oracle不支持自增列,所以我们需要使用序列(sequence)来实现自增列 </para>
/// </summary>
/// <typeparam name="T">泛型类型</typeparam>
/// <param name="entity">要插入的实体</param>
/// <param name="identity">是否返回自增主键值</param>
/// <param name="identitySql">返回自增主键sql</param>
/// <param name="identitySql">返回自增主键sql
/// <list type="bullet">
/// <item>SqlServer: SELECT SCOPE_IDENTITY()</item>
/// <item>MySql: SELECT LAST_INSERT_ID()</item>
/// <item>Sqlite: SELECT LAST_INSERT_ROWID()</item>
/// <item>PostgreSql: RETURNING $PRIMARYKEY,其中$PRIMARYKEY为主键列名占位符</item>
/// <item>Oracle: SELECT $SEQUENCE.CURRVAL FROM DUAL,其中$SEQUENCE为自定义SEQUENCE名占位符</item>
/// </list>
/// </param>
/// <returns>若 <paramref name="identity"/>为 true,则返回自增主键值,否则返回受影响行数</returns>
public abstract long Insert<T>(T entity, bool identity, string identitySql = null) where T : class;

Expand Down Expand Up @@ -2042,12 +2050,20 @@ public virtual async Task<int> InsertAsync<T>(T entity) where T : class
}

/// <summary>
/// 插入单个实体
/// 插入单个实体 <para>注意:因为Oracle不支持自增列,所以我们需要使用序列(sequence)来实现自增列 </para>
/// </summary>
/// <typeparam name="T">泛型类型</typeparam>
/// <param name="entity">要插入的实体</param>
/// <param name="identity">是否返回自增主键值</param>
/// <param name="identitySql">返回自增主键sql</param>
/// <param name="identitySql">返回自增主键sql
/// <list type="bullet">
/// <item>SqlServer: SELECT SCOPE_IDENTITY()</item>
/// <item>MySql: SELECT LAST_INSERT_ID()</item>
/// <item>Sqlite: SELECT LAST_INSERT_ROWID()</item>
/// <item>PostgreSql: RETURNING $PRIMARYKEY,其中$PRIMARYKEY为主键列名占位符</item>
/// <item>Oracle: SELECT $SEQUENCE.CURRVAL FROM DUAL,其中$SEQUENCE为自定义SEQUENCE名占位符</item>
/// </list>
/// </param>
/// <returns>若 <paramref name="identity"/>为 true,则返回自增主键值,否则返回受影响行数</returns>
public abstract Task<long> InsertAsync<T>(T entity, bool identity, string identitySql = null) where T : class;

Expand Down

0 comments on commit fca79b1

Please sign in to comment.