public void AssignBrandCredentials(BrandCredentialsData data) { var brand = _repository.Brands.Single(x => x.Id == data.BrandId); using (var scope = CustomTransactionScope.GetTransactionScope()) { brand.ClientId = data.ClientId; brand.ClientSecret = data.ClientSecret; _repository.SaveChanges(); scope.Complete(); } }
public void AssignBrandCredentials(BrandCredentialsData data) { var brand = _repository.Brands.Single(x => x.Id == data.BrandId); using (var scope = CustomTransactionScope.GetTransactionScope()) { brand.ClientId = data.ClientId; brand.ClientSecret = data.ClientSecret; _repository.SaveChanges(); _eventBus.Publish(new BrandCredentialsUpdated() { Id = brand.Id, AggregateId = brand.Id, ClientId = brand.ClientId, ClientSecret = brand.ClientSecret, UpdatedDate = DateTimeOffset.UtcNow.ToBrandOffset(brand.TimezoneId), UpdatedBy = _actorInfoProvider.Actor.UserName }); scope.Complete(); } }