// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { // Add framework services. var nJsonApiConfig = NJsonApiConfiguration.BuildConfiguration(); nJsonApiConfig.Apply(services); }
public static void Register(HttpConfiguration config) { config.Formatters.Clear(); config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); // The following code bootstraps NJsonApi var nJsonApiConfig = NJsonApiConfiguration.BuildConfiguration(); nJsonApiConfig.Apply(config); }