public async Task <ScheduleModel> GetScheduleForChat(string chatId) { var chat = _context.Chats.Where(x => x.ChatId == chatId).FirstOrDefault(); if (chat is null) { throw new ChatDontExistException(); } var schedule = _context.Schedules.Where(x => x.ScheduleId == chat.ScheduleId) .Include(x => x.Alerts).FirstOrDefault(); if (schedule is null) { throw new ScheduleDontExistException(); } var output = _converter.ConvertScheduleToDTO(schedule); return(output); }