Ejemplo n.º 1
0
        // 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);
        }
Ejemplo n.º 2
0
        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);
        }