public async Task <ActionResult <AttendeeViewModel> > DeleteAttendee(int meetingId, int attendeeId)
        {
            var entity = await _attendeeRepository.GetWithRolesAsync(attendeeId);

            if (null == entity)
            {
                return(NotFound());
            }

            if (meetingId != entity.MeetingId)
            {
                return(BadRequest());
            }

            var exists = _meetingRepository.Exists(meetingId);

            if (false == exists)
            {
                return(BadRequest());
            }

            _attendeeRepository.Remove(entity);

            await _attendeeRepository.CompleteAsync();

            return(ViewModelHelper.Convert(entity));
        }
예제 #2
0
 public void Delete(Guid id)
 {
     _atendeeRepository.Remove(id);
 }