/// <summary> /// Hooks the given profiler into core operations, allowing for recording relevant execution times /// </summary> public static void AddProfiler(this OptionsConfigurationBuilder builder, IProfiler profiler) { var operationProfiler = new OperationProfiler(profiler); builder.Decorate <IEventStore>(c => new EventStoreDecorator(c.Get <IEventStore>(), operationProfiler)); builder.Decorate <IAggregateRootRepository>(c => new AggregateRootRepositoryDecorator(c.Get <IAggregateRootRepository>(), operationProfiler)); builder.Decorate <IEventDispatcher>(c => new EventDispatcherDecorator(c.Get <IEventDispatcher>(), operationProfiler)); }
public AggregateRootRepositoryDecorator(IAggregateRootRepository innnerAggregateRootRepository, OperationProfiler operationProfiler) { _innnerAggregateRootRepository = innnerAggregateRootRepository; _operationProfiler = operationProfiler; }
public EventDispatcherDecorator(IEventDispatcher innerEventDispatcher, OperationProfiler operationProfiler) { _innerEventDispatcher = innerEventDispatcher; _operationProfiler = operationProfiler; }
public EventStoreDecorator(IEventStore innerEventStore, OperationProfiler operationProfiler) { _innerEventStore = innerEventStore; _operationProfiler = operationProfiler; }