Exemplo n.º 1
0
        private static IConstructorChooserPolicy GetConstructorChooser(IBuilderContext context, Type typeToBuild,
                                                                       string idToBuild)
        {
            IConstructorChooserPolicy ctorChooser =
                context.Policies.Get <IConstructorChooserPolicy>(typeToBuild, idToBuild);

            if (ctorChooser == null)
            {
                ctorChooser = new DefaultConstructorChooserPolicy();
                context.Policies.Set <IConstructorChooserPolicy>(ctorChooser, typeToBuild, idToBuild);
            }
            return(ctorChooser);
        }
        private static IConstructorChooserPolicy GetConstructorChooser(IBuilderContext context, Type typeToBuild,
		                                                               string idToBuild)
        {
            IConstructorChooserPolicy ctorChooser =
                context.Policies.Get<IConstructorChooserPolicy>(typeToBuild, idToBuild);

            if (ctorChooser == null)
            {
                ctorChooser = new DefaultConstructorChooserPolicy();
                context.Policies.Set<IConstructorChooserPolicy>(ctorChooser, typeToBuild, idToBuild);
            }
            return ctorChooser;
        }