public async Task <ActionResult> UpdateEventAsync(
            Guid eventId,
            [FromBody] UpdateEventViewModel entity)
        {
            var validator           = new UpdateEventViewModelValidator(_utilityService, _mapper);
            ValidationResult result = validator.Validate(entity);

            if (!result.IsValid)
            {
                return(BadRequest(new ErrorResponseFormat(result.Errors.First().ErrorMessage)));
            }

            var targetEvent = await _service.GetEventAsync(eventId);

            if (targetEvent == null)
            {
                return(BadRequest(new ErrorResponseFormat(Constants.Errors.EVENT_NOT_FOUND)));
            }

            if (targetEvent.Creator.Id != new Guid(
                    User.FindFirst(JwtRegisteredClaimNames.Jti).Value))
            {
                return(BadRequest(new ErrorResponseFormat(Constants.Errors.NO_UPDATE_RIGHTS)));
            }

            var updateResult = await _service.UpdateEventAsync(eventId,
                                                               _mapper.Map <UpdateEventModel>(entity));

            return(Ok());
        }
        public async Task <ActionResult> CreateEventAsync(
            [FromBody] UpdateEventViewModel entity)
        {
            var validator           = new UpdateEventViewModelValidator(_utilityService, _mapper);
            ValidationResult result = validator.Validate(entity);

            if (!result.IsValid)
            {
                return(BadRequest(new ErrorResponseFormat(result.Errors.First().ErrorMessage)));
            }

            CreateEventModel createEventModel = new CreateEventModel();

            _mapper.Map(entity, createEventModel);
            createEventModel.CreatorId = new Guid(
                User.FindFirst(JwtRegisteredClaimNames.Jti).Value);

            var createdEvent = await _service.CreateEventAsync(createEventModel);

            return(Ok(_mapper.Map <EventViewModel>(createdEvent)));
        }