Global.asax.cs 965 B

12345678910111213141516171819202122232425262728293031323334
  1. using Newtonsoft.Json;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Web;
  6. using System.Web.Http;
  7. using System.Web.Mvc;
  8. using System.Web.Optimization;
  9. using System.Web.Routing;
  10. namespace EVCB_OCPP.WEBAPI
  11. {
  12. public class WebApiApplication : System.Web.HttpApplication
  13. {
  14. protected void Application_Start()
  15. {
  16. AreaRegistration.RegisterAllAreas();
  17. GlobalConfiguration.Configure(WebApiConfig.Register);
  18. FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
  19. RouteConfig.RegisterRoutes(RouteTable.Routes);
  20. BundleConfig.RegisterBundles(BundleTable.Bundles);
  21. var formatter = GlobalConfiguration.Configuration.Formatters.JsonFormatter;
  22. formatter.SerializerSettings = new JsonSerializerSettings
  23. {
  24. NullValueHandling = NullValueHandling.Ignore
  25. };
  26. }
  27. }
  28. }