public InventoryItemModule(EventStoreClient eventStore, IMessageTypeMapper messageTypeMapper, JsonSerializerOptions serializerOptions) { Build <DefineInventoryItem>() .Log() .UnitOfWork(eventStore, messageTypeMapper, serializerOptions) .Handle((_, ct) => { var(unitOfWork, command) = _; var handlers = new InventoryItemHandlers( new InventoryItemRepository(eventStore, messageTypeMapper, unitOfWork)); return(handlers.Handle(command, ct)); }); }
public InventoryItemModule(EventStoreClient eventStore, IMessageTypeMapper messageTypeMapper, JsonSerializerOptions serializerOptions) { var handlers = new InventoryItemHandlers(new InventoryItemRepository(eventStore, messageTypeMapper)); Build <DefineInventoryItem>() .Log() .UnitOfWork(eventStore, messageTypeMapper, serializerOptions) .Handle(async(command, ct) => { await handlers.Handle(command, ct); return(Checkpoint.None); }); }