Exemplo n.º 1
0
        public static void AddNakedFunctions(this NakedCoreOptions coreOptions, Action <NakedFunctionsOptions> setupAction)
        {
            var options = new NakedFunctionsOptions();

            setupAction(options);

            options.RegisterCustomTypes?.Invoke(coreOptions.Services);

            ParallelConfig.RegisterWellKnownServices(coreOptions.Services);
            coreOptions.Services.RegisterFacetFactories <IFunctionalFacetFactoryProcessor>(FunctionalFacetFactories.StandardFacetFactories());
            coreOptions.Services.AddSingleton <FunctionalFacetFactorySet, FunctionalFacetFactorySet>();
            coreOptions.Services.AddSingleton <FunctionClassStrategy, FunctionClassStrategy>();
            coreOptions.Services.AddSingleton <IReflector, FunctionalReflector>();
            coreOptions.Services.AddSingleton <IFunctionalReflectorConfiguration>(p => FunctionalReflectorConfig(options));
        }
Exemplo n.º 2
0
 public static FunctionalReflectorConfiguration FunctionalReflectorConfig(NakedFunctionsOptions options) =>
 new FunctionalReflectorConfiguration(options.FunctionalTypes, options.Functions, options.ConcurrencyCheck);