示例#1
0
        public async Task CompleteQuestAsync(Guid guid, QuestState state, CancellationToken cancellationToken)
        {
            var quest = await _context.Quest.FirstOrDefaultAsync(x => x.Guid == guid, cancellationToken);

            if (quest == null)
            {
                throw new Exception("Квест не найден");
            }

            quest.State = state;

            await _context.SaveChangesAsync(cancellationToken);
        }
示例#2
0
        public async Task CompleteConquestAsync(Guid guid, int?completeRate, CancellationToken cancellationToken)
        {
            var conquest = await _context.Conquest
                           .FirstOrDefaultAsync(x => x.Guid == guid, cancellationToken);

            if (conquest == null)
            {
                throw new Exception("Конквест не найден");
            }

            conquest.CompleteRate = completeRate;
            await _context
            .SaveChangesAsync(cancellationToken);
        }
示例#3
0
 public Task AddPatientAsync(Patient patient, CancellationToken cancellationToken)
 {
     _context.Patient.Add(patient);
     return(_context.SaveChangesAsync(cancellationToken));
 }