コード例 #1
0
 UpsertListAsync <T>(IEnumerable <T> entitiesToUpsert, Action <T> insertAction, Action <T> updateAction)
     where T : class =>
 await ExecuteInternalAsync(
     () => SharedConnection.UpsertListAsync(entitiesToUpsert, insertAction, updateAction, _transaction,
                                            OneTimeCommandTimeout ?? CommandTimeout), true);
コード例 #2
0
 /// <summary>
 ///     Updates or inserts a list of entities and returns true if successful.
 /// </summary>
 /// <typeparam name="T">The type of entity to update or insert.</typeparam>
 /// <param name="entitiesToUpsert">The list of Entity to update or insert.</param>
 /// <param name="columnsToUpdate">The columns to update if the record exists.</param>
 /// <param name="insertAction">A callback function before the record is inserted.</param>
 /// <param name="updateAction">A callback function before the record is updated.</param>
 /// <returns>
 ///     True if the records are updated or inserted.
 /// </returns>
 public async Task <bool> UpsertListAsync <T>(IEnumerable <T> entitiesToUpsert, IEnumerable <string> columnsToUpdate,
                                              Action <T> insertAction, Action <T> updateAction) where T : class => await ExecuteInternalAsync(
     () => SharedConnection.UpsertListAsync(entitiesToUpsert, columnsToUpdate, insertAction, updateAction,
                                            _transaction, OneTimeCommandTimeout ?? CommandTimeout), true);
コード例 #3
0
 /// <summary>
 ///     Updates or inserts a list of entities and returns true if successful.
 /// </summary>
 /// <typeparam name="T">The type of entity to update or insert.</typeparam>
 /// <param name="entitiesToUpsert">The list of Entity to update or insert.</param>
 /// <returns>
 ///     True if the records are updated or inserted.
 /// </returns>
 public async Task <bool> UpsertListAsync <T>(IEnumerable <T> entitiesToUpsert) where T : class =>
 await ExecuteInternalAsync(
     () => SharedConnection.UpsertListAsync(entitiesToUpsert, _transaction,
                                            OneTimeCommandTimeout ?? CommandTimeout), true);