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); }
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); }