public async Task AddToEvent(Guid eventId, AddMemberToEventRequest request) { var @event = await _eventRepository.Get(eventId); EnsureEventExists(@event); var member = await _memberRepository.Get(request.MemberId); EnsureMemberExists(member); _memberRepository.AddMemberToEvent(@event, request.MemberId); await EnsureMemberAddedInDataBase(); }
public async Task <IActionResult> Add(Guid eventId, [FromBody] AddMemberToEventRequest request) { await _memberService.AddToEvent(eventId, request); return(Ok()); }