コード例 #1
0
        private async Task AddPriceEpisodesToDataLocks()
        {
            _dataLockEventPriceEpisodeAy1.DataLockEventId = _dataLockEventAy1.EventId;
            _dataDataContext.DataLockEventPriceEpisode.Add(_dataLockEventPriceEpisodeAy1);

            _dataLockEventPriceEpisodeAy2.DataLockEventId = _dataLockEventAy2.EventId;
            _dataDataContext.DataLockEventPriceEpisode.Add(_dataLockEventPriceEpisodeAy2);

            await _dataDataContext.SaveChangesAsync();
        }
        private async Task AddDataLockToDb()
        {
            _dataLockEvent.LearnerUln           = _uln;
            _dataLockEvent.Ukprn                = _ukprn;
            _dataLockEvent.EventId              = Guid.NewGuid();
            _dataLockEvent.LearningAimReference = "ZPROG001";
            _dataLockEvent.CollectionPeriod     = 11;
            _dataLockEvent.AcademicYear         = 2021;

            _dataDataContext.DataLockEvent.Add(_dataLockEvent);

            await _dataDataContext.SaveChangesAsync();
        }
コード例 #3
0
        public async Task SaveSubmissionJob(SubmissionJobModel submissionJob)
        {
            _logger.LogInformation($"Saving Submission Job, DcJobId {submissionJob.DcJobId}");

            try
            {
                await _dataContext.SubmissionJobs.AddAsync(submissionJob);

                await _dataContext.SaveChangesAsync();
            }
            catch (Exception e)
            {
                if (e.IsUniqueKeyConstraintException())
                {
                    _logger.LogInformation($"Discarding duplicate Submission Job. DcJobId {submissionJob.DcJobId}");
                    return;
                }

                throw;
            }
        }