src/fursvp.api/Controllers/EventController.cs
/// <summary>
/// Removes a Member from an Event's sign-ups.
/// </summary>
/// <param name="eventId">The globally unique identifier for the Event.</param>
/// <param name="memberId">The globally unique identifier for the Event's Member to be removed.</param>
/// <returns>204 No Content on success, or 404 Not Found if either the Event Id or Member Id are not found.</returns>
Removes a Member from an Event's sign-ups.
Removes a Member from an Event ' s sign - ups .
[HttpDelete]
        [Route("{eventId}/member/{memberId}")]
        public async Task<IActionResult> RemoveMember(Guid eventId, Guid memberId)
        {
            var @event = await EventRepositoryRead.GetById(eventId).ConfigureAwait(false);
            if (@event == null)
            {
                return NotFound("Event not found with id " + eventId);
            }
            var member = @event.Members.SingleOrDefault(x => x.Id == memberId);
            if (member == null)
            {
                return NotFound("Member not found with id " + memberId);
            }
            @event.Members.Remove(member);
            await EventRepositoryWrite.Update(@event).ConfigureAwait(false);
            return NoContent();
        }
[ HttpDelete ] [ Route ( " " ) ] public async Task < IActionResult > RemoveMember ( Guid eventId , Guid memberId ) { var @event = await EventRepositoryRead . GetById ( eventId ) . ConfigureAwait ( false ) ; if ( @event == null ) { return NotFound ( " " + eventId ) ; } var member = @event . Members . SingleOrDefault ( x => x . Id == memberId ) ; if ( member == null ) { return NotFound ( " " + memberId ) ; } @event . Members . Remove ( member ) ; await EventRepositoryWrite . Update ( @event ) . ConfigureAwait ( false ) ; return NoContent ( ) ; }
Removes a Member from an Event's sign-ups.
Removes a Member from an Event ' s sign - ups .
204 No Content on success, or 404 Not Found if either the Event Id or Member Id are not found.
204 No Content on success or 404 Not Found if either the Event Id or Member Id are not found .
eventId
Guid
The globally unique identifier for the Event.
The globally unique identifier for the Event .
memberId
Guid
The globally unique identifier for the Event's Member to be removed.
The globally unique identifier for the Event ' s Member to be removed .