Пример #1
0
        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);
            }
        }
Пример #3
0
 public void Handle(CategoryDeleted e)
 {
     _repositoryAsync.DeleteAsync(e.Id);
 }
Пример #4
0
 Task IEventHandler <CategoryDeleted> .HandleAsync(CategoryDeleted payload)
 => UpdateModel(payload, model => Models.Remove(model));
Пример #5
0
 Task IEventHandler <CategoryDeleted> .HandleAsync(CategoryDeleted payload) => RaiseEvent(payload);
Пример #6
0
 public void Apply(CategoryDeleted message)
 {
 }
Пример #7
0
 public virtual void OnCategoryDeleted()
 {
     CreateNotification(EventActionType.Deleted);
     CategoryDeleted?.Invoke(this, new NewNotificationEventArgs(this));
 }
Пример #8
0
 public void Apply(CategoryDeleted e)
 {
 }
Пример #9
0
 Task IEventHandler <CategoryDeleted> .HandleAsync(CategoryDeleted payload)
 => Update(payload.AggregateKey, model => models.Remove(model));
Пример #10
0
 public Task HandleAsync(CategoryDeleted payload)
 {
     return(UpdateState(() => IsDeleted = true));
 }
Пример #11
0
 public Task HandleAsync(CategoryDeleted payload)
 {
     return(UpdateItem(payload.AggregateKey, viewModel => Items.Remove(viewModel)));
 }
Пример #12
0
 protected void OnCategoryDeleted(Category category)
 {
     CategoryDeleted?.Invoke(this, category);
 }
Пример #13
0
 public void Handle(CategoryDeleted @event, CommerceInstance instance)
 {
     CategoryTree.Remove(CommerceInstance.Current.Name);
 }