예제 #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddCors(options =>
            {
                options.AddPolicy(MyAllowSpecificOrigins,
                                  builder =>
                {
                    builder.WithOrigins("http://www.contoso.com",
                                        "https://localhost:4200");
                });
            });

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
            services.AddSingleton <GraphQuery>(GraphQuery.GetInstance());
            services.AddSingleton <GraphProcessor>(GraphProcessor.GetInstance());
            services.AddSingleton <CategoryProcessor>(CategoryProcessor.GetInstance());
        }
예제 #2
0
 public void TestInit()
 {
     this.graphClient = GraphQuery.GetInstance();
 }