예제 #1
0
        public static PublishingJobDbContext Publishing(IServiceProvider x, bool beginTrans = true)
        {
            var config  = new StandardEfDbConfig(x.GetRequiredService <IConfiguration>(), DatabaseConnectionStringNames.Publishing);
            var builder = new SqlServerDbContextOptionsBuilder(config, x.GetRequiredService <ILoggerFactory>());
            var result  = new PublishingJobDbContext(builder.Build());

            if (beginTrans)
            {
                result.BeginTransaction();
            }
            return(result);
        }
        private async Task WriteOutput(EksCreateJobOutputEntity e)
        {
            _Logger.LogInformation($"Write EKS {e.CreatingJobQualifier}.");

            await using (_PublishingDbContext.BeginTransaction())
            {
                await _PublishingDbContext.AddAsync(e);

                _PublishingDbContext.SaveAndCommit();
            }
        }