Exemplo n.º 1
0
        public async Task <FridgeDto> Handle(AddFridgeCommand command, CancellationToken cancellationToken)
        {
            var fridge = new Fridge(command.Name, command.Address, command.Desc);
            await _fridgeRepository.AddAsync(fridge);

            await _unitOfWork.CommitAsync(cancellationToken);

            return(new FridgeDto {
                Id = fridge.Id, Name = fridge.Name, Address = fridge.Address, Desc = fridge.Desc
            });
        }