public void Handle(AddDefaultFavoriteAddress command) { var company = _repository.Get(AppConstants.CompanyId); company.AddDefaultFavoriteAddress(command.Address); _repository.Save(company, command.Id.ToString()); }
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 }); }