Esempio n. 1
0
        public static async Task BulkInsertOrUpdateAsync <TEntity>(this ISqlServerBulkInsertEngine bulkInsertEngine, IList <TEntity> entities,
                                                                   BulkInsertOptions options, Action <BulkInsertActionBuilder <TEntity> > postAction, IMapper mapper)
            where TEntity : class
        {
            if (postAction == null)
            {
                throw new ArgumentNullException(nameof(postAction));
            }

            await(bulkInsertEngine ?? throw new ArgumentNullException(nameof(bulkInsertEngine))).BulkInsertOrUpdateAsync(
                entities ?? throw new ArgumentNullException(nameof(entities)), options).ConfigureAwait(false);
            ExecutePostAction(postAction, new BulkInsertActionBuilder <TEntity>(entities, mapper));
        }
Esempio n. 2
0
        public static void BulkInsertOrUpdate <TEntity>(this ISqlServerBulkInsertEngine bulkInsertEngine, IList <TEntity> entities,
                                                        BulkInsertOptions options, Action <BulkInsertActionBuilder <TEntity> > postAction, IMapper mapper)
            where TEntity : class
        {
            if (postAction == null)
            {
                throw new ArgumentNullException(nameof(postAction));
            }

            (bulkInsertEngine ?? throw new ArgumentNullException(nameof(bulkInsertEngine))).BulkInsertOrUpdate(
                entities ?? throw new ArgumentNullException(nameof(entities)), options);
            ExecutePostAction(postAction, new BulkInsertActionBuilder <TEntity>(entities, mapper));
        }
Esempio n. 3
0
 public static DbContextOptionsBuilder <TContext> UseBulkInsertEngine <TContext>(
     this DbContextOptionsBuilder <TContext> optionsBuilder, ISqlServerBulkInsertEngine bulkInsertEngine)
     where TContext : SqlServerDbContext
 {
     return(UseBulkInsertEngine(optionsBuilder, dbContext => bulkInsertEngine));
 }
Esempio n. 4
0
 public static async Task BulkInsertOrUpdateAsync <TEntity>(this ISqlServerBulkInsertEngine bulkInsertEngine, IList <TEntity> entities,
                                                            Action <BulkInsertActionBuilder <TEntity> > postAction, IMapper mapper)
     where TEntity : class
 {
     await BulkInsertOrUpdateAsync(bulkInsertEngine, entities, null, postAction, mapper).ConfigureAwait(false);
 }
Esempio n. 5
0
 public static void BulkInsertOrUpdate <TEntity>(this ISqlServerBulkInsertEngine bulkInsertEngine, IList <TEntity> entities,
                                                 Action <BulkInsertActionBuilder <TEntity> > postAction, IMapper mapper)
     where TEntity : class
 {
     BulkInsertOrUpdate(bulkInsertEngine, entities, null, postAction, mapper);
 }