Пример #1
0
        private ISagaModel DoCreateModel(Type sagaType)
        {
            var handlerInspector =
                AnnotatedHandlerInspector.InspectType(sagaType,
                                                      _parameterResolverFactory,
                                                      _handlerDefinition);

            return(new InspectedSagaModel(handlerInspector.Handlers, this));
        }
Пример #2
0
 public AnnotationEventHandlerAdapter(
     object annotatedEventListener,
     IParameterResolverFactory parameterResolverFactory,
     IHandlerDefinition handlerDefinition
     )
 {
     _annotatedEventListener = annotatedEventListener;
     _listenerType           = annotatedEventListener.GetType();
     _inspector = AnnotatedHandlerInspector <object> .InspectType(annotatedEventListener.GetType(),
                                                                  parameterResolverFactory,
                                                                  handlerDefinition);
 }
        public AnnotatedAggregateModel CreateModel(Type aggregateType)
        {
            if (!_registry.ContainsKey(aggregateType))
            {
                var inspector = AnnotatedHandlerInspector.InspectType(aggregateType,
                                                                      _parameterResolverFactory,
                                                                      _handlerDefinition);
                var model = new AnnotatedAggregateModel(aggregateType, inspector, this);
                model.Initialize();
                _registry[aggregateType] = model;
            }

            return(_registry[aggregateType]);
        }