コード例 #1
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 bool UpsertList <T>(IEnumerable <T> entitiesToUpsert, IEnumerable <string> columnsToUpdate,
                            Action <T> insertAction, Action <T> updateAction) where T : class => ExecuteInternal(
     () => SharedConnection.UpsertList(entitiesToUpsert, columnsToUpdate, 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>
 /// <returns>
 ///     True if the records are updated or inserted.
 /// </returns>
 public bool UpsertList <T>(IEnumerable <T> entitiesToUpsert) where T : class => ExecuteInternal(
     () => SharedConnection.UpsertList(entitiesToUpsert, _transaction, OneTimeCommandTimeout ?? CommandTimeout),
     true);