public static async Task AddPersonToMeeting(int participantId, int meetingId) { Task <Participant> participantTask = ParticipantRead.GetParticipant(participantId); Task <Meeting> meetingTask = MeetingRead.GetMeeting(meetingId, m => m.Participants); await Task.WhenAll(meetingTask, participantTask); if (meetingTask.Result.Participants.Any(p => p.Id == participantId)) { throw new Exception("Participant is already enrolled in this meeting"); } await MeetingWrite.AddParticipantToMeeting(participantTask.Result, meetingTask.Result); }
public static async Task UpdateMeeting(MeetingDto meetingDto) { Meeting meetingEntity = Convert(meetingDto); await MeetingWrite.UpdateMeeting(meetingEntity); }