static ServiceLayerAndClientComponentResolving()
        {
            IoC.Container = null;
            KnownTypeProvider.ClearAllKnownTypes();
            requestHandlerAssemblies = new List <Assembly> {
                Assembly.GetExecutingAssembly(), typeof(RequestHandlerB).Assembly
            };
            requestResponseAssemblies = new List <Assembly> {
                Assembly.GetExecutingAssembly(), typeof(RequestB).Assembly
            };
            var configuration = new ServiceLayerAndClientConfiguration(Assembly.GetExecutingAssembly(), Assembly.GetExecutingAssembly(),
                                                                       Activator.CreateInstance <TContainer>());

            configuration.AddRequestHandlerAssembly(typeof(RequestHandlerB).Assembly);
            configuration.AddRequestAndResponseAssembly(typeof(RequestB).Assembly);
            configuration.Use <RequestHandlerBasedConventions>();
            configuration.Initialize();
        }
Example #2
0
        /// <summary>
        ///     Configures the agatha.
        /// </summary>
        /// <param name="appContainer">The app container.</param>
        protected virtual void ConfigureAgatha(IContainer appContainer)
        {
            var structureMapContainer = new Agatha.StructureMap.Container(appContainer);

            IoC.Container = structureMapContainer;

            var serviceLayerAndClientConfiguration =
                new ServiceLayerAndClientConfiguration(typeof(GetLookupsByCategoryRequestHandler).Assembly,
                                                       typeof(GetLookupsByCategoryRequest).Assembly,
                                                       structureMapContainer);

            // register agatha conventions
            serviceLayerAndClientConfiguration.Use <RequestHandlerBasedConventions> ();

            serviceLayerAndClientConfiguration.RequestDispatcherImplementation = typeof(AsyncRequestDispatcher);

            serviceLayerAndClientConfiguration.RequestProcessorImplementation =
                typeof(NHibernateTransactionRequestProcessor);

            serviceLayerAndClientConfiguration.Initialize();
            //KnownTypeProvider.ClearAllKnownTypes();
            //KnownTypesHelper.RegisterRequestsAndResponses(typeof(SaveDtoRequest<>).Assembly);
        }