Example #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IDataAccesService dataAccesService)
        {
            DataAccesService = dataAccesService;
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            {
                app.UseHsts();
            }

            app.UseHttpsRedirection();


            app.UseMvc(routeBuilder =>
            {
                // routeBuilder : ajouté les methodes de Odata et buildé le url de l API
                routeBuilder.Expand().Select().Count().OrderBy().Filter().MaxTop(null);
                routeBuilder.MapODataServiceRoute("Employe", "odata/v1/employes", EdmModelBuilder.GetEdmModelEmployes(DataAccesService));
            });
        }