예제 #1
0
        public async Task AddToEvent(Guid eventId, AddLocationToEventRequest request)
        {
            var @event = await _eventRepository.Get(eventId);

            EnsureEventExists(@event);

            var newLocation = _mapper.Map <Location>(request.Location);

            await ValidateLocation(newLocation);

            _locationRepository.AddLocation(@event, newLocation);

            await EnsureLocationIsSavedInDataBase();
        }
예제 #2
0
        public async Task <IActionResult> Add(Guid eventId, [FromBody] AddLocationToEventRequest request)
        {
            await _locationService.AddToEvent(eventId, request);

            return(Ok());
        }