Пример #1
0
        public async Task <OfficeDto> Handle(CreateOfficeCommand request, CancellationToken cancellationToken)
        {
            var office = new Office(request.OfficeCode);

            await _officeRepository.AddAsync(office);

            await _unitOfWork.Commit();

            var dto = _mapper.Map <OfficeDto>(office);

            return(dto);
        }