feat: add items #wip

This commit is contained in:
k0t9i
2023-02-02 16:54:38 +04:00
parent 03423d0c41
commit c35f4e317a
14 changed files with 273 additions and 49 deletions

View File

@@ -0,0 +1,30 @@
using Client.Domain.Entities;
using Client.Domain.Events;
using Client.Domain.Factories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Client.Domain.Service
{
public class ItemHander : EntityHandler<BaseItem>
{
public override void OnCreate(BaseItem entity)
{
eventBus.Publish(new ItemCreatedEvent(entity));
}
public override void OnDelete(BaseItem entity)
{
eventBus.Publish(new ItemDeletedEvent(entity.Id));
}
public ItemHander(EntityFactoryInterface<BaseItem> factory, EventBusInterface eventBus) : base(factory)
{
this.eventBus = eventBus;
}
private readonly EventBusInterface eventBus;
}
}