예제 #1
0
        public async Task UpdateAsync(int settlementId, CreateSettlementDto dto)
        {
            var settlement = await _settlementRepository.FindByIdAsync(settlementId);

            if (settlement == null)
            {
                throw new ResourceNotFoundException();
            }

            MapToInstance(dto, settlement);

            await _settlementRepository.UpdateAsync(settlement);
        }
예제 #2
0
        public async Task CreateAsync(CreateEventDto dto)
        {
            if (_settlementRepository.FindByIdAsync(dto.SettlementId) == null)
            {
                throw new ResourceNotFoundException();
            }

            var @event = Map <CreateEventDto, Event>(dto);
            await _eventRepository.CreateAsync(@event);
        }