public async Task HandleAsync(CategoryDeleted payload) { using (ReadModelContext db = readModelContextFactory.Create()) { CategoryEntity entity = await db.Categories.FindAsync(payload.AggregateKey.AsGuidKey().Guid); entity.IsDeleted = true; await db.SaveChangesAsync(); } }
public void Handle(CategoryDeleted @event, CommerceInstance instance) { var languageStore = GetLanguageStoreByInstance(instance.Name); var translationStore = GetTranlsationStoreByInstance(instance.Name); var key = new EntityKey(typeof(Category), @event.CategoryId); foreach (var lang in languageStore.All()) { translationStore.Delete(CultureInfo.GetCultureInfo(lang.Name), key); } }
public void Handle(CategoryDeleted e) { _repositoryAsync.DeleteAsync(e.Id); }
Task IEventHandler <CategoryDeleted> .HandleAsync(CategoryDeleted payload) => UpdateModel(payload, model => Models.Remove(model));
Task IEventHandler <CategoryDeleted> .HandleAsync(CategoryDeleted payload) => RaiseEvent(payload);
public void Apply(CategoryDeleted message) { }
public virtual void OnCategoryDeleted() { CreateNotification(EventActionType.Deleted); CategoryDeleted?.Invoke(this, new NewNotificationEventArgs(this)); }
public void Apply(CategoryDeleted e) { }
Task IEventHandler <CategoryDeleted> .HandleAsync(CategoryDeleted payload) => Update(payload.AggregateKey, model => models.Remove(model));
public Task HandleAsync(CategoryDeleted payload) { return(UpdateState(() => IsDeleted = true)); }
public Task HandleAsync(CategoryDeleted payload) { return(UpdateItem(payload.AggregateKey, viewModel => Items.Remove(viewModel))); }
protected void OnCategoryDeleted(Category category) { CategoryDeleted?.Invoke(this, category); }
public void Handle(CategoryDeleted @event, CommerceInstance instance) { CategoryTree.Remove(CommerceInstance.Current.Name); }