Last active
December 28, 2016 08:51
-
-
Save Msirkovsky/7eaf0c637942cfc1468a5fabc6bb4928 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class WebApiConfig | |
{ | |
public static void Register(HttpConfiguration config) | |
{ | |
config.Routes.MapHttpRoute( | |
name: "DefaultApi", | |
routeTemplate: "api/{controller}/{id}", | |
defaults: new { id = RouteParameter.Optional } | |
); | |
config.EnableQuerySupport(); | |
var modelBuilder = new ODataConventionModelBuilder(); | |
modelBuilder.EntitySet<DataSalesForExcel>("DataSalesForExcel"); | |
var model = modelBuilder.GetEdmModel(); | |
config.Routes.MapODataRoute("ODataRoute", "odata", model); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment