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); }
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); }
public Task AddPatientAsync(Patient patient, CancellationToken cancellationToken) { _context.Patient.Add(patient); return(_context.SaveChangesAsync(cancellationToken)); }