コード例 #1
0
ファイル: Startup.cs プロジェクト: loxadim/NJsonApi
        // 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);
        }
コード例 #2
0
ファイル: WebApiConfig.cs プロジェクト: sauravvijay/NJsonApi
        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);
        }