Ejemplo n.º 1
0
        public async Task <AddressResponse> Handle(AddAddressCommand request, CancellationToken cancellationToken)
        {
            //maping
            var addressModel = new Address()
            {
                Name = request.Name, City = request.City, Street = request.Street
            };

            var resultAddressModel = await _addressRepo.AddOne(addressModel);

            //maping
            var resultAdddresResponse = new AddressResponse()
            {
                Id = resultAddressModel.Id, Name = resultAddressModel.Name, City = resultAddressModel.City, Street = resultAddressModel.Street
            };

            return(resultAdddresResponse);
        }