Beispiel #1
0
        public void FacilityRegistersRequiredComponents()
        {
            Assert.IsTrue(kernel.HasComponent(typeof(MethodValidatorMetaStore)));
            Assert.IsTrue(kernel.HasComponent(typeof(MethodValidatorInterceptor)));
            IContributeComponentModelConstruction methodValidatorContributor = null;

            foreach (IContributeComponentModelConstruction contributor in kernel.ComponentModelBuilder.Contributors)
            {
                if (contributor is MethodValidatorComponentInspector)
                {
                    methodValidatorContributor = contributor;
                }
            }
            Assert.IsNotNull(methodValidatorContributor);
        }
Beispiel #2
0
        public static IWindsorContainer Configure(
            IWindsorContainer container,
            IContributeComponentModelConstruction contributor)
        {
            container = container ?? new WindsorContainer();

            if (contributor != null)
            {
                container.Kernel.ComponentModelBuilder.AddContributor(contributor);
            }

            container
            .Install(new DbContextInstaller())
            .Install(new RepositoryInstaller())
            .Install(new DataServiceInstaller())
            .Install(new DataComponentInstaller());

            return(container);
        }
		/// <summary>
		///   "To give or supply in common with others; give to a
		///   common fund or for a common purpose". The contributor
		///   should inspect the component, or even the configuration
		///   associated with the component, to add or change information
		///   in the model that can be used later.
		/// </summary>
		/// <param name = "contributor"></param>
		public void AddContributor(IContributeComponentModelConstruction contributor)
		{
			contributors.Add(contributor);
		}
		/// <summary>
		///   Removes the specified contributor
		/// </summary>
		/// <param name = "contributor"></param>
		public void RemoveContributor(IContributeComponentModelConstruction contributor)
		{
			contributors.Remove(contributor);
		}
Beispiel #5
0
 public void RemoveContributor(IContributeComponentModelConstruction contributor)
 {
     contributors.Remove(contributor);
 }
Beispiel #6
0
 public void AddContributor(IContributeComponentModelConstruction contributor)
 {
     contributors.Add(contributor);
 }
Beispiel #7
0
 public AspNetCoreFacility(IServiceCollection services)
 {
     this.services    = services;
     this.contributor = new AspNetCoreComponentModelContributor(services);
 }