private static IMenu[] CombinedNOandNFMenus(IMenuFactory mf)
        {
            var menus = ModelConfig_NakedFunctionsPM.MainMenus(mf).ToList();

            //menus.AddRange(ModelConfig_NakedObjectsPM.MainMenus(mf));
            return(menus.ToArray());
        }
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers()
            .AddNewtonsoftJson(options => options.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.Utc);
            services.AddMvc(options => options.EnableEndpointRouting = false);
            services.AddHttpContextAccessor();
            services.AddNakedFramework(builder => {
                builder.MainMenus = CombinedNOandNFMenus;
                builder.AddEntityPersistor(options => {
                    options.ContextInstallers = new[] { ModelConfig_NakedFunctionsPM.DbContextInstaller };
                });
                //builder.AddNakedObjects(options => {
                //    options.Types = ModelConfig_NakedObjectsPM.DomainTypes();
                //    options.Services = ModelConfig_NakedObjectsPM.Services();
                //    options.NoValidate = true;
                //});
                builder.AddNakedFunctions(options => {
                    options.FunctionalTypes = ModelConfig_NakedFunctionsPM.DomainTypes();
                    options.Functions       = ModelConfig_NakedFunctionsPM.DomainFunctions();
                });
                builder.AddRestfulObjects();
            });

            services.AddCors(options => {
                options.AddPolicy(MyAllowSpecificOrigins, builder => {
                    builder
                    .WithOrigins("http://localhost:49998",
                                 "http://localhost:8080",
                                 "http://nakedfunctionstest.azurewebsites.net",
                                 "https://nakedfunctionstest.azurewebsites.net")
                    .AllowAnyHeader()
                    .WithExposedHeaders("Warning", "ETag", "Set-Cookie")
                    .AllowAnyMethod()
                    .AllowCredentials();
                });
            });
        }