public async Task <IHttpActionResult> Create(CreateEventTypeViewModel eventTypeViewModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var eventTypeDto = _mapper.Map <CreateEventTypeViewModel, CreateEventTypeDto>(eventTypeViewModel); SetOrganizationAndUser(eventTypeDto); try { await _eventUtilitiesService.CreateEventTypeAsync(eventTypeDto); } catch (ValidationException e) { return(BadRequestWithError(e)); } return(Ok()); }