예제 #1
0
        public void Handle(AddDefaultFavoriteAddress command)
        {
            var company = _repository.Get(AppConstants.CompanyId);

            company.AddDefaultFavoriteAddress(command.Address);
            _repository.Save(company, command.Id.ToString());
        }
예제 #2
0
        public object Post(DefaultFavoriteAddress request)
        {
            var command = new AddDefaultFavoriteAddress();

            Mapper.Map(request, command);
            command.Address.Id = request.Id == Guid.Empty ? Guid.NewGuid() : request.Id;

            _commandBus.Send(command);

            return(new { command.Address.Id });
        }