Beispiel #1
0
 static void Setup(NakedCoreOptions coreOptions)
 {
     coreOptions.SupportedSystemTypes = t => Array.Empty <Type>();
     coreOptions.AddNakedObjects(options => {
         options.Types      = Array.Empty <Type>();
         options.Services   = Array.Empty <Type>();
         options.NoValidate = true;
     });
 }
 static void Setup(NakedCoreOptions coreOptions)
 {
     coreOptions.SupportedSystemTypes = t => Array.Empty <Type>();
     coreOptions.AddNakedObjects(EmptyObjectSetup);
     coreOptions.AddNakedFunctions(options => {
         options.FunctionalTypes = Array.Empty <Type>();
         options.Functions       = Array.Empty <Type>();
     }
                                   );
 }
Beispiel #3
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));
        }
Beispiel #4
0
        public static void AddRestfulObjects(this NakedCoreOptions coreOptions, Action <RestfulObjectsOptions> setupAction = null)
        {
            var options = new RestfulObjectsOptions();

            setupAction?.Invoke(options);

            // TODO configure with config object ?
            RestfulObjectsControllerBase.DebugWarnings      = options.DebugWarnings;
            RestfulObjectsControllerBase.IsReadOnly         = options.IsReadOnly;
            RestfulObjectsControllerBase.CacheSettings      = options.CacheSettings;
            RestfulObjectsControllerBase.AcceptHeaderStrict = options.AcceptHeaderStrict;
            RestfulObjectsControllerBase.DefaultPageSize    = options.DefaultPageSize;
            RestfulObjectsControllerBase.InlineDetailsInActionMemberRepresentations     = options.InlineDetailsInActionMemberRepresentations;
            RestfulObjectsControllerBase.InlineDetailsInCollectionMemberRepresentations = options.InlineDetailsInCollectionMemberRepresentations;
            RestfulObjectsControllerBase.InlineDetailsInPropertyMemberRepresentations   = options.InlineDetailsInPropertyMemberRepresentations;
        }
        public static void AddNakedObjects(this NakedCoreOptions coreOptions, Action <NakedObjectsOptions> setupAction)
        {
            var options = new NakedObjectsOptions();

            setupAction(options);

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


            coreOptions.Services.RegisterFacetFactories <IObjectFacetFactoryProcessor>(ObjectFacetFactories.StandardFacetFactories());
            coreOptions.Services.AddSingleton <ObjectFacetFactorySet, ObjectFacetFactorySet>();
            coreOptions.Services.AddSingleton <ObjectClassStrategy, ObjectClassStrategy>();
            coreOptions.Services.AddSingleton <SystemTypeFacetFactorySet, SystemTypeFacetFactorySet>();
            coreOptions.Services.AddSingleton <SystemTypeClassStrategy, SystemTypeClassStrategy>();

            coreOptions.Services.AddSingleton <IReflector, SystemTypeReflector>();
            coreOptions.Services.AddSingleton <IReflector, ObjectReflector>();
            coreOptions.Services.AddSingleton <IObjectReflectorConfiguration>(p => ObjectReflectorConfig(options));
        }