Robert 2 жил өмнө
parent
commit
e14decdb4e
100 өөрчлөгдсөн 1818 нэмэгдсэн , 3997 устгасан
  1. 14 14
      EVCB_OCPP.WEBAPI/App_Start/BundleConfig.cs
  2. 7 7
      EVCB_OCPP.WEBAPI/App_Start/FilterConfig.cs
  3. 12 12
      EVCB_OCPP.WEBAPI/App_Start/RouteConfig.cs
  4. 27 27
      EVCB_OCPP.WEBAPI/App_Start/WebApiConfig.cs
  5. 0 38
      EVCB_OCPP.WEBAPI/Areas/HelpPage/ApiDescriptionExtensions.cs
  6. 0 111
      EVCB_OCPP.WEBAPI/Areas/HelpPage/App_Start/HelpPageConfig.cs
  7. 0 62
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Controllers/HelpController.cs
  8. 0 134
      EVCB_OCPP.WEBAPI/Areas/HelpPage/HelpPage.css
  9. 0 24
      EVCB_OCPP.WEBAPI/Areas/HelpPage/HelpPageAreaRegistration.cs
  10. 0 465
      EVCB_OCPP.WEBAPI/Areas/HelpPage/HelpPageConfigurationExtensions.cs
  11. 0 7
      EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/CollectionModelDescription.cs
  12. 0 14
      EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/ComplexTypeModelDescription.cs
  13. 0 6
      EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/DictionaryModelDescription.cs
  14. 0 15
      EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/EnumTypeModelDescription.cs
  15. 0 11
      EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/EnumValueDescription.cs
  16. 0 12
      EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/IModelDocumentationProvider.cs
  17. 0 9
      EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/KeyValuePairModelDescription.cs
  18. 0 16
      EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/ModelDescription.cs
  19. 0 449
      EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/ModelDescriptionGenerator.cs
  20. 0 18
      EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/ModelNameAttribute.cs
  21. 0 36
      EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/ModelNameHelper.cs
  22. 0 11
      EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/ParameterAnnotation.cs
  23. 0 21
      EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/ParameterDescription.cs
  24. 0 6
      EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/SimpleTypeModelDescription.cs
  25. 0 107
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Models/HelpPageApiModel.cs
  26. 0 443
      EVCB_OCPP.WEBAPI/Areas/HelpPage/SampleGeneration/HelpPageSampleGenerator.cs
  27. 0 172
      EVCB_OCPP.WEBAPI/Areas/HelpPage/SampleGeneration/HelpPageSampleKey.cs
  28. 0 41
      EVCB_OCPP.WEBAPI/Areas/HelpPage/SampleGeneration/ImageSample.cs
  29. 0 37
      EVCB_OCPP.WEBAPI/Areas/HelpPage/SampleGeneration/InvalidSample.cs
  30. 0 456
      EVCB_OCPP.WEBAPI/Areas/HelpPage/SampleGeneration/ObjectGenerator.cs
  31. 0 11
      EVCB_OCPP.WEBAPI/Areas/HelpPage/SampleGeneration/SampleDirection.cs
  32. 0 37
      EVCB_OCPP.WEBAPI/Areas/HelpPage/SampleGeneration/TextSample.cs
  33. 0 21
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/Api.cshtml
  34. 0 38
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ApiGroup.cshtml
  35. 0 6
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/CollectionModelDescription.cshtml
  36. 0 3
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ComplexTypeModelDescription.cshtml
  37. 0 4
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/DictionaryModelDescription.cshtml
  38. 0 24
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/EnumTypeModelDescription.cshtml
  39. 0 65
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/HelpPageApiModel.cshtml
  40. 0 4
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ImageSample.cshtml
  41. 0 14
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/InvalidSample.cshtml
  42. 0 4
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/KeyValuePairModelDescription.cshtml
  43. 0 26
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ModelDescriptionLink.cshtml
  44. 0 47
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/Parameters.cshtml
  45. 0 30
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/Samples.cshtml
  46. 0 3
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/SimpleTypeModelDescription.cshtml
  47. 0 6
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/TextSample.cshtml
  48. 0 35
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/Index.cshtml
  49. 0 18
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/ResourceModel.cshtml
  50. 0 12
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Shared/_Layout.cshtml
  51. 0 41
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Web.config
  52. 0 4
      EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/_ViewStart.cshtml
  53. 0 159
      EVCB_OCPP.WEBAPI/Areas/HelpPage/XmlDocumentationProvider.cs
  54. 21 0
      EVCB_OCPP.WEBAPI/Controllers/TestController.cs
  55. 39 39
      EVCB_OCPP.WEBAPI/Controllers/Version1/CPOController.cs
  56. 31 23
      EVCB_OCPP.WEBAPI/Controllers/Version1/InternalController.cs
  57. 33 26
      EVCB_OCPP.WEBAPI/Controllers/Version2/V2_CPOController.cs
  58. 56 49
      EVCB_OCPP.WEBAPI/Controllers/Version2/ocpp16/OCPP16_CPOController.cs
  59. 30 22
      EVCB_OCPP.WEBAPI/Controllers/Version2/ocpp16/OCPP16_InternalController.cs
  60. 15 7
      EVCB_OCPP.WEBAPI/Controllers/Version2/ocpp201/OCPP201_CPOController.cs
  61. 29 20
      EVCB_OCPP.WEBAPI/Controllers/Version2/ocpp201/OCPP201_InternalController.cs
  62. 7 3
      EVCB_OCPP.WEBAPI/EVCB_OCPP.WEBAPI.csproj
  63. 16 16
      EVCB_OCPP.WEBAPI/Global.asax.cs
  64. 185 185
      EVCB_OCPP.WEBAPI/Handlers/APILogHandler.cs
  65. 11 3
      EVCB_OCPP.WEBAPI/Handlers/CPOAuthentication.cs
  66. 22 34
      EVCB_OCPP.WEBAPI/Handlers/GlobalExceptionHandler .cs
  67. 71 3
      EVCB_OCPP.WEBAPI/Handlers/InernalAuthentication.cs
  68. 18 19
      EVCB_OCPP.WEBAPI/Helpers/WebApiHelper.cs
  69. 197 0
      EVCB_OCPP.WEBAPI/Middleware/APILogMiddleware.cs
  70. 39 0
      EVCB_OCPP.WEBAPI/Middleware/ExceptionMiddleware.cs
  71. 1 1
      EVCB_OCPP.WEBAPI/Properties/launchSettings.json
  72. 13 3
      EVCB_OCPP.WEBAPI/Services/ChargePointService.cs
  73. 13 3
      EVCB_OCPP.WEBAPI/Services/ChargingStationService.cs
  74. 4 3
      EVCB_OCPP.WEBAPI/Services/CustomerService.cs
  75. 14 3
      EVCB_OCPP.WEBAPI/Services/Integration/ChargePoint16Service.cs
  76. 10 2
      EVCB_OCPP.WEBAPI/Services/Integration/ChargePoint201Service.cs
  77. 16 5
      EVCB_OCPP.WEBAPI/Services/Integration/ChargingStationService.cs
  78. 5 3
      EVCB_OCPP.WEBAPI/Services/Integration/ServerTriggerService.cs
  79. 7 2
      EVCB_OCPP.WEBAPI/Services/ServerTriggerService.cs
  80. 22 0
      EVCB_OCPP.WEBAPI/Startup.cs
  81. 0 24
      EVCB_OCPP.WEBAPI/Views/Home/Index.cshtml
  82. 0 14
      EVCB_OCPP.WEBAPI/Views/Shared/Error.cshtml
  83. 0 43
      EVCB_OCPP.WEBAPI/Views/Shared/_Layout.cshtml
  84. 0 43
      EVCB_OCPP.WEBAPI/Views/Web.config
  85. 0 3
      EVCB_OCPP.WEBAPI/Views/_ViewImports.cshtml
  86. 0 3
      EVCB_OCPP.WEBAPI/Views/_ViewStart.cshtml
  87. 64 0
      EVCB_OCPP.WEBAPI/wwwroot/css/app.css
  88. 5 0
      EVCB_OCPP.WEBAPI/wwwroot/css/bootstrap/bootstrap.min.css
  89. 0 0
      EVCB_OCPP.WEBAPI/wwwroot/css/bootstrap/bootstrap.min.css.map
  90. 86 0
      EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/FONT-LICENSE
  91. 21 0
      EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/ICON-LICENSE
  92. 114 0
      EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/README.md
  93. 0 0
      EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css
  94. BIN
      EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/font/fonts/open-iconic.eot
  95. BIN
      EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/font/fonts/open-iconic.otf
  96. 543 0
      EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/font/fonts/open-iconic.svg
  97. BIN
      EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf
  98. BIN
      EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/font/fonts/open-iconic.woff
  99. BIN
      EVCB_OCPP.WEBAPI/wwwroot/favicon.ico
  100. BIN
      EVCB_OCPP.WEBAPI/wwwroot/icon-192.png

+ 14 - 14
EVCB_OCPP.WEBAPI/App_Start/BundleConfig.cs

@@ -4,22 +4,22 @@ namespace EVCB_OCPP.WEBAPI
     public class BundleConfig
     {
         // 如需統合的詳細資訊,請瀏覽 https://go.microsoft.com/fwlink/?LinkId=301862
-        public static void RegisterBundles(BundleCollection bundles)
-        {
-            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
-                        "~/Scripts/jquery-{version}.js"));
+        //public static void RegisterBundles(BundleCollection bundles)
+        //{
+        //    bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
+        //                "~/Scripts/jquery-{version}.js"));
 
-            // 使用開發版本的 Modernizr 進行開發並學習。然後,當您
-            // 準備好可進行生產時,請使用 https://modernizr.com 的建置工具,只挑選您需要的測試。
-            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
-                        "~/Scripts/modernizr-*"));
+        //    // 使用開發版本的 Modernizr 進行開發並學習。然後,當您
+        //    // 準備好可進行生產時,請使用 https://modernizr.com 的建置工具,只挑選您需要的測試。
+        //    bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
+        //                "~/Scripts/modernizr-*"));
 
-            bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
-                      "~/Scripts/bootstrap.js"));
+        //    bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
+        //              "~/Scripts/bootstrap.js"));
 
-            bundles.Add(new StyleBundle("~/Content/css").Include(
-                      "~/Content/bootstrap.css",
-                      "~/Content/site.css"));
-        }
+        //    bundles.Add(new StyleBundle("~/Content/css").Include(
+        //              "~/Content/bootstrap.css",
+        //              "~/Content/site.css"));
+        //}
     }
 }

+ 7 - 7
EVCB_OCPP.WEBAPI/App_Start/FilterConfig.cs

@@ -1,11 +1,11 @@
 
 namespace EVCB_OCPP.WEBAPI
 {
-    public class FilterConfig
-    {
-        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
-        {
-            filters.Add(new HandleErrorAttribute());
-        }
-    }
+    //public class FilterConfig
+    //{
+    //    public static void RegisterGlobalFilters(GlobalFilterCollection filters)
+    //    {
+    //        filters.Add(new HandleErrorAttribute());
+    //    }
+    //}
 }

+ 12 - 12
EVCB_OCPP.WEBAPI/App_Start/RouteConfig.cs

@@ -4,17 +4,17 @@ using System.Linq;
 
 namespace EVCB_OCPP.WEBAPI
 {
-    public class RouteConfig
-    {
-        public static void RegisterRoutes(RouteCollection routes)
-        {
-            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
+    //public class RouteConfig
+    //{
+    //    public static void RegisterRoutes(RouteCollection routes)
+    //    {
+    //        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
 
-            routes.MapRoute(
-                name: "Default",
-                url: "{controller}/{action}/{id}",
-                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
-            );
-        }
-    }
+    //        routes.MapRoute(
+    //            name: "Default",
+    //            url: "{controller}/{action}/{id}",
+    //            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
+    //        );
+    //    }
+    //}
 }

+ 27 - 27
EVCB_OCPP.WEBAPI/App_Start/WebApiConfig.cs

@@ -3,38 +3,38 @@ using Newtonsoft.Json;
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using static EVCB_OCPP.WEBAPI.Handlers.APILogHandler;
+//using static EVCB_OCPP.WEBAPI.Handlers.APILogHandler;
 
 namespace EVCB_OCPP.WEBAPI
 {
-    public static class WebApiConfig
-    {
-        public static void Register(HttpConfiguration config)
-        {
-            config.Formatters.JsonFormatter.SerializerSettings = new JsonSerializerSettings
-            {
-                NullValueHandling = NullValueHandling.Ignore,
-                DateFormatString = EVCBConfiguration.UTC_DATETIMEFORMAT
-            };
+    //public static class WebApiConfig
+    //{
+    //    public static void Register(HttpConfiguration config)
+    //    {
+    //        config.Formatters.JsonFormatter.SerializerSettings = new JsonSerializerSettings
+    //        {
+    //            NullValueHandling = NullValueHandling.Ignore,
+    //            DateFormatString = EVCBConfiguration.UTC_DATETIMEFORMAT
+    //        };
 
-            config.MessageHandlers.Add(new ApiLogHandler());
-            // Web API 設定和服務
-            config.Services.Replace(typeof(IExceptionHandler), new GlobalExceptionHandler());
-            // Web API 路由
-            config.MapHttpAttributeRoutes();
+    //        config.MessageHandlers.Add(new ApiLogHandler());
+    //        // Web API 設定和服務
+    //        config.Services.Replace(typeof(IExceptionHandler), new GlobalExceptionHandler());
+    //        // Web API 路由
+    //        config.MapHttpAttributeRoutes();
 
-            config.Routes.MapHttpRoute(
-                name: "DefaultApi",
-                routeTemplate: "api/v1/{controller}/{id}",
-                defaults: new { id = RouteParameter.Optional }
-            );
+    //        config.Routes.MapHttpRoute(
+    //            name: "DefaultApi",
+    //            routeTemplate: "api/v1/{controller}/{id}",
+    //            defaults: new { id = RouteParameter.Optional }
+    //        );
 
 
-            config.Routes.MapHttpRoute(
-              name: "Version2",
-              routeTemplate: "api/v2/{controller}/{id}",
-              defaults: new { id = RouteParameter.Optional }
-          );
-        }
-    }
+    //        config.Routes.MapHttpRoute(
+    //          name: "Version2",
+    //          routeTemplate: "api/v2/{controller}/{id}",
+    //          defaults: new { id = RouteParameter.Optional }
+    //      );
+    //    }
+    //}
 }

+ 0 - 38
EVCB_OCPP.WEBAPI/Areas/HelpPage/ApiDescriptionExtensions.cs

@@ -1,38 +0,0 @@
-using Microsoft.AspNetCore.Mvc.ApiExplorer;
-using System;
-using System.Text;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage
-{
-    public static class ApiDescriptionExtensions
-    {
-        /// <summary>
-        /// Generates an URI-friendly ID for the <see cref="ApiDescription"/>. E.g. "Get-Values-id_name" instead of "GetValues/{id}?name={name}"
-        /// </summary>
-        /// <param name="description">The <see cref="ApiDescription"/>.</param>
-        /// <returns>The ID as a string.</returns>
-        public static string GetFriendlyId(this ApiDescription description)
-        {
-            string path = description.RelativePath;
-            string[] urlParts = path.Split('?');
-            string localPath = urlParts[0];
-            string queryKeyString = null;
-            if (urlParts.Length > 1)
-            {
-                string query = urlParts[1];
-                string[] queryKeys = HttpUtility.ParseQueryString(query).AllKeys;
-                queryKeyString = String.Join("_", queryKeys);
-            }
-
-            StringBuilder friendlyPath = new StringBuilder();
-            friendlyPath.AppendFormat("{0}-{1}",
-                description.HttpMethod,
-                localPath.Replace("/", "-").Replace("{", String.Empty).Replace("}", String.Empty));
-            if (queryKeyString != null)
-            {
-                friendlyPath.AppendFormat("_{0}", queryKeyString.Replace('.', '-'));
-            }
-            return friendlyPath.ToString();
-        }
-    }
-}

+ 0 - 111
EVCB_OCPP.WEBAPI/Areas/HelpPage/App_Start/HelpPageConfig.cs

@@ -1,111 +0,0 @@
-// Uncomment the following to provide samples for PageResult<T>. Must also add the Microsoft.AspNet.WebApi.OData
-// package to your project.
-////#define Handle_PageResultOfT
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
-using System.Linq;
-using System.Net.Http.Headers;
-using System.Reflection;
-#if Handle_PageResultOfT
-using System.Web.Http.OData;
-#endif
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage
-{
-    /// <summary>
-    /// Use this class to customize the Help Page.
-    /// For example you can set a custom <see cref="System.Web.Http.Description.IDocumentationProvider"/> to supply the documentation
-    /// or you can provide the samples for the requests/responses.
-    /// </summary>
-    public static class HelpPageConfig
-    {
-        [SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters",
-            MessageId = "EVCB_OCPP.WEBAPI.Areas.HelpPage.TextSample.#ctor(System.String)",
-            Justification = "End users may choose to merge this string with existing localized resources.")]
-        [SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly",
-            MessageId = "bsonspec",
-            Justification = "Part of a URI.")]
-        public static void Register(HttpConfiguration config)
-        {
-            //// Uncomment the following to use the documentation from XML documentation file.
-            //config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));
-
-            //// Uncomment the following to use "sample string" as the sample for all actions that have string as the body parameter or return type.
-            //// Also, the string arrays will be used for IEnumerable<string>. The sample objects will be serialized into different media type 
-            //// formats by the available formatters.
-            //config.SetSampleObjects(new Dictionary<Type, object>
-            //{
-            //    {typeof(string), "sample string"},
-            //    {typeof(IEnumerable<string>), new string[]{"sample 1", "sample 2"}}
-            //});
-
-            // Extend the following to provide factories for types not handled automatically (those lacking parameterless
-            // constructors) or for which you prefer to use non-default property values. Line below provides a fallback
-            // since automatic handling will fail and GeneratePageResult handles only a single type.
-#if Handle_PageResultOfT
-            config.GetHelpPageSampleGenerator().SampleObjectFactories.Add(GeneratePageResult);
-#endif
-
-            // Extend the following to use a preset object directly as the sample for all actions that support a media
-            // type, regardless of the body parameter or return type. The lines below avoid display of binary content.
-            // The BsonMediaTypeFormatter (if available) is not used to serialize the TextSample object.
-            config.SetSampleForMediaType(
-                new TextSample("Binary JSON content. See http://bsonspec.org for details."),
-                new MediaTypeHeaderValue("application/bson"));
-
-            //// Uncomment the following to use "[0]=foo&[1]=bar" directly as the sample for all actions that support form URL encoded format
-            //// and have IEnumerable<string> as the body parameter or return type.
-            //config.SetSampleForType("[0]=foo&[1]=bar", new MediaTypeHeaderValue("application/x-www-form-urlencoded"), typeof(IEnumerable<string>));
-
-            //// Uncomment the following to use "1234" directly as the request sample for media type "text/plain" on the controller named "Values"
-            //// and action named "Put".
-            //config.SetSampleRequest("1234", new MediaTypeHeaderValue("text/plain"), "Values", "Put");
-
-            //// Uncomment the following to use the image on "../images/aspNetHome.png" directly as the response sample for media type "image/png"
-            //// on the controller named "Values" and action named "Get" with parameter "id".
-            //config.SetSampleResponse(new ImageSample("../images/aspNetHome.png"), new MediaTypeHeaderValue("image/png"), "Values", "Get", "id");
-
-            //// Uncomment the following to correct the sample request when the action expects an HttpRequestMessage with ObjectContent<string>.
-            //// The sample will be generated as if the controller named "Values" and action named "Get" were having string as the body parameter.
-            //config.SetActualRequestType(typeof(string), "Values", "Get");
-
-            //// Uncomment the following to correct the sample response when the action returns an HttpResponseMessage with ObjectContent<string>.
-            //// The sample will be generated as if the controller named "Values" and action named "Post" were returning a string.
-            //config.SetActualResponseType(typeof(string), "Values", "Post");
-        }
-
-#if Handle_PageResultOfT
-        private static object GeneratePageResult(HelpPageSampleGenerator sampleGenerator, Type type)
-        {
-            if (type.IsGenericType)
-            {
-                Type openGenericType = type.GetGenericTypeDefinition();
-                if (openGenericType == typeof(PageResult<>))
-                {
-                    // Get the T in PageResult<T>
-                    Type[] typeParameters = type.GetGenericArguments();
-                    Debug.Assert(typeParameters.Length == 1);
-
-                    // Create an enumeration to pass as the first parameter to the PageResult<T> constuctor
-                    Type itemsType = typeof(List<>).MakeGenericType(typeParameters);
-                    object items = sampleGenerator.GetSampleObject(itemsType);
-
-                    // Fill in the other information needed to invoke the PageResult<T> constuctor
-                    Type[] parameterTypes = new Type[] { itemsType, typeof(Uri), typeof(long?), };
-                    object[] parameters = new object[] { items, null, (long)ObjectGenerator.DefaultCollectionSize, };
-
-                    // Call PageResult(IEnumerable<T> items, Uri nextPageLink, long? count) constructor
-                    ConstructorInfo constructor = type.GetConstructor(parameterTypes);
-                    return constructor.Invoke(parameters);
-                }
-            }
-
-            return null;
-        }
-#endif
-    }
-}

+ 0 - 62
EVCB_OCPP.WEBAPI/Areas/HelpPage/Controllers/HelpController.cs

@@ -1,62 +0,0 @@
-using System;
-using EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions;
-using EVCB_OCPP.WEBAPI.Areas.HelpPage.Models;
-using Microsoft.AspNetCore.Mvc;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage.Controllers
-{
-    /// <summary>
-    /// The controller that will handle requests for the help page.
-    /// </summary>
-    public class HelpController : Controller
-    {
-        private const string ErrorViewName = "Error";
-
-        public HelpController()
-            : this(GlobalConfiguration.Configuration)
-        {
-        }
-
-        public HelpController(HttpConfiguration config)
-        {
-            Configuration = config;
-        }
-
-        public HttpConfiguration Configuration { get; private set; }
-
-        public ActionResult Index()
-        {
-            ViewBag.DocumentationProvider = Configuration.Services.GetDocumentationProvider();
-            return View(Configuration.Services.GetApiExplorer().ApiDescriptions);
-        }
-
-        public ActionResult Api(string apiId)
-        {
-            if (!String.IsNullOrEmpty(apiId))
-            {
-                HelpPageApiModel apiModel = Configuration.GetHelpPageApiModel(apiId);
-                if (apiModel != null)
-                {
-                    return View(apiModel);
-                }
-            }
-
-            return View(ErrorViewName);
-        }
-
-        public ActionResult ResourceModel(string modelName)
-        {
-            if (!String.IsNullOrEmpty(modelName))
-            {
-                ModelDescriptionGenerator modelDescriptionGenerator = Configuration.GetModelDescriptionGenerator();
-                ModelDescription modelDescription;
-                if (modelDescriptionGenerator.GeneratedModels.TryGetValue(modelName, out modelDescription))
-                {
-                    return View(modelDescription);
-                }
-            }
-
-            return View(ErrorViewName);
-        }
-    }
-}

+ 0 - 134
EVCB_OCPP.WEBAPI/Areas/HelpPage/HelpPage.css

@@ -1,134 +0,0 @@
-.help-page h1,
-.help-page .h1,
-.help-page h2,
-.help-page .h2,
-.help-page h3,
-.help-page .h3,
-#body.help-page,
-.help-page-table th,
-.help-page-table pre,
-.help-page-table p {
-    font-family: "Segoe UI Light", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
-}
-
-.help-page pre.wrapped {
-    white-space: -moz-pre-wrap;
-    white-space: -pre-wrap;
-    white-space: -o-pre-wrap;
-    white-space: pre-wrap;
-}
-
-.help-page .warning-message-container {
-    margin-top: 20px;
-    padding: 0 10px;
-    color: #525252;
-    background: #EFDCA9; 
-    border: 1px solid #CCCCCC;
-}
-
-.help-page-table {
-    width: 100%;
-    border-collapse: collapse;
-    text-align: left;
-    margin: 0px 0px 20px 0px;
-    border-top: 1px solid #D4D4D4;
-}
-
-.help-page-table th {
-    text-align: left;
-    font-weight: bold;
-    border-bottom: 1px solid #D4D4D4;
-    padding: 5px 6px 5px 6px;
-}
-
-.help-page-table td {
-    border-bottom: 1px solid #D4D4D4;
-    padding: 10px 8px 10px 8px;
-    vertical-align: top;
-}
-
-.help-page-table pre,
-.help-page-table p {
-    margin: 0px;
-    padding: 0px;
-    font-family: inherit;
-    font-size: 100%;
-}
-
-.help-page-table tbody tr:hover td {
-    background-color: #F3F3F3;
-}
-
-.help-page a:hover {
-    background-color: transparent;
-}
-
-.help-page .sample-header {
-    border: 2px solid #D4D4D4;
-    background: #00497E;
-    color: #FFFFFF;
-    padding: 8px 15px;
-    border-bottom: none;
-    display: inline-block;
-    margin: 10px 0px 0px 0px;
-}
-
-.help-page .sample-content {
-    display: block;
-    border-width: 0;
-    padding: 15px 20px;
-    background: #FFFFFF;
-    border: 2px solid #D4D4D4;
-    margin: 0px 0px 10px 0px;
-}
-
-.help-page .api-name {
-    width: 40%;
-}
-
-.help-page .api-documentation {
-    width: 60%;
-}
-
-.help-page .parameter-name {
-    width: 20%;
-}
-
-.help-page .parameter-documentation {
-    width: 40%;
-}
-
-.help-page .parameter-type {
-    width: 20%;
-}
-
-.help-page .parameter-annotations {
-    width: 20%;
-}
-
-.help-page h1,
-.help-page .h1 {
-    font-size: 36px;
-    line-height: normal;
-}
-
-.help-page h2,
-.help-page .h2 {
-    font-size: 24px;
-}
-
-.help-page h3,
-.help-page .h3 {
-    font-size: 20px;
-}
-
-#body.help-page {
-    font-size: 14px;
-    line-height: 143%;
-    color: #333;
-}
-
-.help-page a {
-    color: #0000EE;
-    text-decoration: none;
-}

+ 0 - 24
EVCB_OCPP.WEBAPI/Areas/HelpPage/HelpPageAreaRegistration.cs

@@ -1,24 +0,0 @@
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage
-{
-    public class HelpPageAreaRegistration : AreaRegistration
-    {
-        public override string AreaName
-        {
-            get
-            {
-                return "HelpPage";
-            }
-        }
-
-        public override void RegisterArea(AreaRegistrationContext context)
-        {
-            context.MapRoute(
-                "HelpPage_Default",
-                "Help/{action}/{apiId}",
-                new { controller = "Help", action = "Index", apiId = UrlParameter.Optional });
-
-            HelpPageConfig.Register(GlobalConfiguration.Configuration);
-        }
-    }
-}

+ 0 - 465
EVCB_OCPP.WEBAPI/Areas/HelpPage/HelpPageConfigurationExtensions.cs

@@ -1,465 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
-using System.Globalization;
-using System.Linq;
-using System.Net.Http;
-using System.Net.Http.Headers;
-using EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions;
-using EVCB_OCPP.WEBAPI.Areas.HelpPage.Models;
-using Microsoft.AspNetCore.Mvc.ApiExplorer;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage
-{
-    public static class HelpPageConfigurationExtensions
-    {
-        private const string ApiModelPrefix = "MS_HelpPageApiModel_";
-
-        /// <summary>
-        /// Sets the documentation provider for help page.
-        /// </summary>
-        /// <param name="config">The <see cref="HttpConfiguration"/>.</param>
-        /// <param name="documentationProvider">The documentation provider.</param>
-        public static void SetDocumentationProvider(this HttpConfiguration config, IDocumentationProvider documentationProvider)
-        {
-            config.Services.Replace(typeof(IDocumentationProvider), documentationProvider);
-        }
-
-        /// <summary>
-        /// Sets the objects that will be used by the formatters to produce sample requests/responses.
-        /// </summary>
-        /// <param name="config">The <see cref="HttpConfiguration"/>.</param>
-        /// <param name="sampleObjects">The sample objects.</param>
-        public static void SetSampleObjects(this HttpConfiguration config, IDictionary<Type, object> sampleObjects)
-        {
-            config.GetHelpPageSampleGenerator().SampleObjects = sampleObjects;
-        }
-
-        /// <summary>
-        /// Sets the sample request directly for the specified media type and action.
-        /// </summary>
-        /// <param name="config">The <see cref="HttpConfiguration"/>.</param>
-        /// <param name="sample">The sample request.</param>
-        /// <param name="mediaType">The media type.</param>
-        /// <param name="controllerName">Name of the controller.</param>
-        /// <param name="actionName">Name of the action.</param>
-        public static void SetSampleRequest(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName)
-        {
-            config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Request, controllerName, actionName, new[] { "*" }), sample);
-        }
-
-        /// <summary>
-        /// Sets the sample request directly for the specified media type and action with parameters.
-        /// </summary>
-        /// <param name="config">The <see cref="HttpConfiguration"/>.</param>
-        /// <param name="sample">The sample request.</param>
-        /// <param name="mediaType">The media type.</param>
-        /// <param name="controllerName">Name of the controller.</param>
-        /// <param name="actionName">Name of the action.</param>
-        /// <param name="parameterNames">The parameter names.</param>
-        public static void SetSampleRequest(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName, params string[] parameterNames)
-        {
-            config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Request, controllerName, actionName, parameterNames), sample);
-        }
-
-        /// <summary>
-        /// Sets the sample request directly for the specified media type of the action.
-        /// </summary>
-        /// <param name="config">The <see cref="HttpConfiguration"/>.</param>
-        /// <param name="sample">The sample response.</param>
-        /// <param name="mediaType">The media type.</param>
-        /// <param name="controllerName">Name of the controller.</param>
-        /// <param name="actionName">Name of the action.</param>
-        public static void SetSampleResponse(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName)
-        {
-            config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Response, controllerName, actionName, new[] { "*" }), sample);
-        }
-
-        /// <summary>
-        /// Sets the sample response directly for the specified media type of the action with specific parameters.
-        /// </summary>
-        /// <param name="config">The <see cref="HttpConfiguration"/>.</param>
-        /// <param name="sample">The sample response.</param>
-        /// <param name="mediaType">The media type.</param>
-        /// <param name="controllerName">Name of the controller.</param>
-        /// <param name="actionName">Name of the action.</param>
-        /// <param name="parameterNames">The parameter names.</param>
-        public static void SetSampleResponse(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName, params string[] parameterNames)
-        {
-            config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Response, controllerName, actionName, parameterNames), sample);
-        }
-
-        /// <summary>
-        /// Sets the sample directly for all actions with the specified media type.
-        /// </summary>
-        /// <param name="config">The <see cref="HttpConfiguration"/>.</param>
-        /// <param name="sample">The sample.</param>
-        /// <param name="mediaType">The media type.</param>
-        public static void SetSampleForMediaType(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType)
-        {
-            config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType), sample);
-        }
-
-        /// <summary>
-        /// Sets the sample directly for all actions with the specified type and media type.
-        /// </summary>
-        /// <param name="config">The <see cref="HttpConfiguration"/>.</param>
-        /// <param name="sample">The sample.</param>
-        /// <param name="mediaType">The media type.</param>
-        /// <param name="type">The parameter type or return type of an action.</param>
-        public static void SetSampleForType(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, Type type)
-        {
-            config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, type), sample);
-        }
-
-        /// <summary>
-        /// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> passed to the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
-        /// The help page will use this information to produce more accurate request samples.
-        /// </summary>
-        /// <param name="config">The <see cref="HttpConfiguration"/>.</param>
-        /// <param name="type">The type.</param>
-        /// <param name="controllerName">Name of the controller.</param>
-        /// <param name="actionName">Name of the action.</param>
-        public static void SetActualRequestType(this HttpConfiguration config, Type type, string controllerName, string actionName)
-        {
-            config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Request, controllerName, actionName, new[] { "*" }), type);
-        }
-
-        /// <summary>
-        /// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> passed to the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
-        /// The help page will use this information to produce more accurate request samples.
-        /// </summary>
-        /// <param name="config">The <see cref="HttpConfiguration"/>.</param>
-        /// <param name="type">The type.</param>
-        /// <param name="controllerName">Name of the controller.</param>
-        /// <param name="actionName">Name of the action.</param>
-        /// <param name="parameterNames">The parameter names.</param>
-        public static void SetActualRequestType(this HttpConfiguration config, Type type, string controllerName, string actionName, params string[] parameterNames)
-        {
-            config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Request, controllerName, actionName, parameterNames), type);
-        }
-
-        /// <summary>
-        /// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> returned as part of the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
-        /// The help page will use this information to produce more accurate response samples.
-        /// </summary>
-        /// <param name="config">The <see cref="HttpConfiguration"/>.</param>
-        /// <param name="type">The type.</param>
-        /// <param name="controllerName">Name of the controller.</param>
-        /// <param name="actionName">Name of the action.</param>
-        public static void SetActualResponseType(this HttpConfiguration config, Type type, string controllerName, string actionName)
-        {
-            config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Response, controllerName, actionName, new[] { "*" }), type);
-        }
-
-        /// <summary>
-        /// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> returned as part of the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
-        /// The help page will use this information to produce more accurate response samples.
-        /// </summary>
-        /// <param name="config">The <see cref="HttpConfiguration"/>.</param>
-        /// <param name="type">The type.</param>
-        /// <param name="controllerName">Name of the controller.</param>
-        /// <param name="actionName">Name of the action.</param>
-        /// <param name="parameterNames">The parameter names.</param>
-        public static void SetActualResponseType(this HttpConfiguration config, Type type, string controllerName, string actionName, params string[] parameterNames)
-        {
-            config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Response, controllerName, actionName, parameterNames), type);
-        }
-
-        /// <summary>
-        /// Gets the help page sample generator.
-        /// </summary>
-        /// <param name="config">The <see cref="HttpConfiguration"/>.</param>
-        /// <returns>The help page sample generator.</returns>
-        public static HelpPageSampleGenerator GetHelpPageSampleGenerator(this HttpConfiguration config)
-        {
-            return (HelpPageSampleGenerator)config.Properties.GetOrAdd(
-                typeof(HelpPageSampleGenerator),
-                k => new HelpPageSampleGenerator());
-        }
-
-        /// <summary>
-        /// Sets the help page sample generator.
-        /// </summary>
-        /// <param name="config">The <see cref="HttpConfiguration"/>.</param>
-        /// <param name="sampleGenerator">The help page sample generator.</param>
-        public static void SetHelpPageSampleGenerator(this HttpConfiguration config, HelpPageSampleGenerator sampleGenerator)
-        {
-            config.Properties.AddOrUpdate(
-                typeof(HelpPageSampleGenerator),
-                k => sampleGenerator,
-                (k, o) => sampleGenerator);
-        }
-
-        /// <summary>
-        /// Gets the model description generator.
-        /// </summary>
-        /// <param name="config">The configuration.</param>
-        /// <returns>The <see cref="ModelDescriptionGenerator"/></returns>
-        public static ModelDescriptionGenerator GetModelDescriptionGenerator(this HttpConfiguration config)
-        {
-            return (ModelDescriptionGenerator)config.Properties.GetOrAdd(
-                typeof(ModelDescriptionGenerator),
-                k => InitializeModelDescriptionGenerator(config));
-        }
-
-        /// <summary>
-        /// Gets the model that represents an API displayed on the help page. The model is initialized on the first call and cached for subsequent calls.
-        /// </summary>
-        /// <param name="config">The <see cref="HttpConfiguration"/>.</param>
-        /// <param name="apiDescriptionId">The <see cref="ApiDescription"/> ID.</param>
-        /// <returns>
-        /// An <see cref="HelpPageApiModel"/>
-        /// </returns>
-        public static HelpPageApiModel GetHelpPageApiModel(this HttpConfiguration config, string apiDescriptionId)
-        {
-            object model;
-            string modelId = ApiModelPrefix + apiDescriptionId;
-            if (!config.Properties.TryGetValue(modelId, out model))
-            {
-                Collection<ApiDescription> apiDescriptions = config.Services.GetApiExplorer().ApiDescriptions;
-                ApiDescription apiDescription = apiDescriptions.FirstOrDefault(api => String.Equals(api.GetFriendlyId(), apiDescriptionId, StringComparison.OrdinalIgnoreCase));
-                if (apiDescription != null)
-                {
-                    model = GenerateApiModel(apiDescription, config);
-                    config.Properties.TryAdd(modelId, model);
-                }
-            }
-
-            return (HelpPageApiModel)model;
-        }
-
-        private static HelpPageApiModel GenerateApiModel(ApiDescription apiDescription, HttpConfiguration config)
-        {
-            HelpPageApiModel apiModel = new HelpPageApiModel()
-            {
-                ApiDescription = apiDescription,
-            };
-
-            ModelDescriptionGenerator modelGenerator = config.GetModelDescriptionGenerator();
-            HelpPageSampleGenerator sampleGenerator = config.GetHelpPageSampleGenerator();
-            GenerateUriParameters(apiModel, modelGenerator);
-            GenerateRequestModelDescription(apiModel, modelGenerator, sampleGenerator);
-            GenerateResourceDescription(apiModel, modelGenerator);
-            GenerateSamples(apiModel, sampleGenerator);
-
-            return apiModel;
-        }
-
-        private static void GenerateUriParameters(HelpPageApiModel apiModel, ModelDescriptionGenerator modelGenerator)
-        {
-            ApiDescription apiDescription = apiModel.ApiDescription;
-            foreach (ApiParameterDescription apiParameter in apiDescription.ParameterDescriptions)
-            {
-                if (apiParameter.Source == ApiParameterSource.FromUri)
-                {
-                    HttpParameterDescriptor parameterDescriptor = apiParameter.ParameterDescriptor;
-                    Type parameterType = null;
-                    ModelDescription typeDescription = null;
-                    ComplexTypeModelDescription complexTypeDescription = null;
-                    if (parameterDescriptor != null)
-                    {
-                        parameterType = parameterDescriptor.ParameterType;
-                        typeDescription = modelGenerator.GetOrCreateModelDescription(parameterType);
-                        complexTypeDescription = typeDescription as ComplexTypeModelDescription;
-                    }
-
-                    // Example:
-                    // [TypeConverter(typeof(PointConverter))]
-                    // public class Point
-                    // {
-                    //     public Point(int x, int y)
-                    //     {
-                    //         X = x;
-                    //         Y = y;
-                    //     }
-                    //     public int X { get; set; }
-                    //     public int Y { get; set; }
-                    // }
-                    // Class Point is bindable with a TypeConverter, so Point will be added to UriParameters collection.
-                    // 
-                    // public class Point
-                    // {
-                    //     public int X { get; set; }
-                    //     public int Y { get; set; }
-                    // }
-                    // Regular complex class Point will have properties X and Y added to UriParameters collection.
-                    if (complexTypeDescription != null
-                        && !IsBindableWithTypeConverter(parameterType))
-                    {
-                        foreach (ParameterDescription uriParameter in complexTypeDescription.Properties)
-                        {
-                            apiModel.UriParameters.Add(uriParameter);
-                        }
-                    }
-                    else if (parameterDescriptor != null)
-                    {
-                        ParameterDescription uriParameter =
-                            AddParameterDescription(apiModel, apiParameter, typeDescription);
-
-                        if (!parameterDescriptor.IsOptional)
-                        {
-                            uriParameter.Annotations.Add(new ParameterAnnotation() { Documentation = "Required" });
-                        }
-
-                        object defaultValue = parameterDescriptor.DefaultValue;
-                        if (defaultValue != null)
-                        {
-                            uriParameter.Annotations.Add(new ParameterAnnotation() { Documentation = "Default value is " + Convert.ToString(defaultValue, CultureInfo.InvariantCulture) });
-                        }
-                    }
-                    else
-                    {
-                        Debug.Assert(parameterDescriptor == null);
-
-                        // If parameterDescriptor is null, this is an undeclared route parameter which only occurs
-                        // when source is FromUri. Ignored in request model and among resource parameters but listed
-                        // as a simple string here.
-                        ModelDescription modelDescription = modelGenerator.GetOrCreateModelDescription(typeof(string));
-                        AddParameterDescription(apiModel, apiParameter, modelDescription);
-                    }
-                }
-            }
-        }
-
-        private static bool IsBindableWithTypeConverter(Type parameterType)
-        {
-            if (parameterType == null)
-            {
-                return false;
-            }
-
-            return TypeDescriptor.GetConverter(parameterType).CanConvertFrom(typeof(string));
-        }
-
-        private static ParameterDescription AddParameterDescription(HelpPageApiModel apiModel,
-            ApiParameterDescription apiParameter, ModelDescription typeDescription)
-        {
-            ParameterDescription parameterDescription = new ParameterDescription
-            {
-                Name = apiParameter.Name,
-                Documentation = apiParameter.Documentation,
-                TypeDescription = typeDescription,
-            };
-
-            apiModel.UriParameters.Add(parameterDescription);
-            return parameterDescription;
-        }
-
-        private static void GenerateRequestModelDescription(HelpPageApiModel apiModel, ModelDescriptionGenerator modelGenerator, HelpPageSampleGenerator sampleGenerator)
-        {
-            ApiDescription apiDescription = apiModel.ApiDescription;
-            foreach (ApiParameterDescription apiParameter in apiDescription.ParameterDescriptions)
-            {
-                if (apiParameter.Source == ApiParameterSource.FromBody)
-                {
-                    Type parameterType = apiParameter.ParameterDescriptor.ParameterType;
-                    apiModel.RequestModelDescription = modelGenerator.GetOrCreateModelDescription(parameterType);
-                    apiModel.RequestDocumentation = apiParameter.Documentation;
-                }
-                else if (apiParameter.ParameterDescriptor != null &&
-                    apiParameter.ParameterDescriptor.ParameterType == typeof(HttpRequestMessage))
-                {
-                    Type parameterType = sampleGenerator.ResolveHttpRequestMessageType(apiDescription);
-
-                    if (parameterType != null)
-                    {
-                        apiModel.RequestModelDescription = modelGenerator.GetOrCreateModelDescription(parameterType);
-                    }
-                }
-            }
-        }
-
-        private static void GenerateResourceDescription(HelpPageApiModel apiModel, ModelDescriptionGenerator modelGenerator)
-        {
-            ResponseDescription response = apiModel.ApiDescription.ResponseDescription;
-            Type responseType = response.ResponseType ?? response.DeclaredType;
-            if (responseType != null && responseType != typeof(void))
-            {
-                apiModel.ResourceDescription = modelGenerator.GetOrCreateModelDescription(responseType);
-            }
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is recorded as ErrorMessages.")]
-        private static void GenerateSamples(HelpPageApiModel apiModel, HelpPageSampleGenerator sampleGenerator)
-        {
-            try
-            {
-                foreach (var item in sampleGenerator.GetSampleRequests(apiModel.ApiDescription))
-                {
-                    apiModel.SampleRequests.Add(item.Key, item.Value);
-                    LogInvalidSampleAsError(apiModel, item.Value);
-                }
-
-                foreach (var item in sampleGenerator.GetSampleResponses(apiModel.ApiDescription))
-                {
-                    apiModel.SampleResponses.Add(item.Key, item.Value);
-                    LogInvalidSampleAsError(apiModel, item.Value);
-                }
-            }
-            catch (Exception e)
-            {
-                apiModel.ErrorMessages.Add(String.Format(CultureInfo.CurrentCulture,
-                    "An exception has occurred while generating the sample. Exception message: {0}",
-                    HelpPageSampleGenerator.UnwrapException(e).Message));
-            }
-        }
-
-        private static bool TryGetResourceParameter(ApiDescription apiDescription, HttpConfiguration config, out ApiParameterDescription parameterDescription, out Type resourceType)
-        {
-            parameterDescription = apiDescription.ParameterDescriptions.FirstOrDefault(
-                p => p.Source == ApiParameterSource.FromBody ||
-                    (p.ParameterDescriptor != null && p.ParameterDescriptor.ParameterType == typeof(HttpRequestMessage)));
-
-            if (parameterDescription == null)
-            {
-                resourceType = null;
-                return false;
-            }
-
-            resourceType = parameterDescription.ParameterDescriptor.ParameterType;
-
-            if (resourceType == typeof(HttpRequestMessage))
-            {
-                HelpPageSampleGenerator sampleGenerator = config.GetHelpPageSampleGenerator();
-                resourceType = sampleGenerator.ResolveHttpRequestMessageType(apiDescription);
-            }
-
-            if (resourceType == null)
-            {
-                parameterDescription = null;
-                return false;
-            }
-
-            return true;
-        }
-
-        private static ModelDescriptionGenerator InitializeModelDescriptionGenerator(HttpConfiguration config)
-        {
-            ModelDescriptionGenerator modelGenerator = new ModelDescriptionGenerator(config);
-            Collection<ApiDescription> apis = config.Services.GetApiExplorer().ApiDescriptions;
-            foreach (ApiDescription api in apis)
-            {
-                ApiParameterDescription parameterDescription;
-                Type parameterType;
-                if (TryGetResourceParameter(api, config, out parameterDescription, out parameterType))
-                {
-                    modelGenerator.GetOrCreateModelDescription(parameterType);
-                }
-            }
-            return modelGenerator;
-        }
-
-        private static void LogInvalidSampleAsError(HelpPageApiModel apiModel, object sample)
-        {
-            InvalidSample invalidSample = sample as InvalidSample;
-            if (invalidSample != null)
-            {
-                apiModel.ErrorMessages.Add(invalidSample.ErrorMessage);
-            }
-        }
-    }
-}

+ 0 - 7
EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/CollectionModelDescription.cs

@@ -1,7 +0,0 @@
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-{
-    public class CollectionModelDescription : ModelDescription
-    {
-        public ModelDescription ElementDescription { get; set; }
-    }
-}

+ 0 - 14
EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/ComplexTypeModelDescription.cs

@@ -1,14 +0,0 @@
-using System.Collections.ObjectModel;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-{
-    public class ComplexTypeModelDescription : ModelDescription
-    {
-        public ComplexTypeModelDescription()
-        {
-            Properties = new Collection<ParameterDescription>();
-        }
-
-        public Collection<ParameterDescription> Properties { get; private set; }
-    }
-}

+ 0 - 6
EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/DictionaryModelDescription.cs

@@ -1,6 +0,0 @@
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-{
-    public class DictionaryModelDescription : KeyValuePairModelDescription
-    {
-    }
-}

+ 0 - 15
EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/EnumTypeModelDescription.cs

@@ -1,15 +0,0 @@
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-{
-    public class EnumTypeModelDescription : ModelDescription
-    {
-        public EnumTypeModelDescription()
-        {
-            Values = new Collection<EnumValueDescription>();
-        }
-
-        public Collection<EnumValueDescription> Values { get; private set; }
-    }
-}

+ 0 - 11
EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/EnumValueDescription.cs

@@ -1,11 +0,0 @@
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-{
-    public class EnumValueDescription
-    {
-        public string Documentation { get; set; }
-
-        public string Name { get; set; }
-
-        public string Value { get; set; }
-    }
-}

+ 0 - 12
EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/IModelDocumentationProvider.cs

@@ -1,12 +0,0 @@
-using System;
-using System.Reflection;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-{
-    public interface IModelDocumentationProvider
-    {
-        string GetDocumentation(MemberInfo member);
-
-        string GetDocumentation(Type type);
-    }
-}

+ 0 - 9
EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/KeyValuePairModelDescription.cs

@@ -1,9 +0,0 @@
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-{
-    public class KeyValuePairModelDescription : ModelDescription
-    {
-        public ModelDescription KeyModelDescription { get; set; }
-
-        public ModelDescription ValueModelDescription { get; set; }
-    }
-}

+ 0 - 16
EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/ModelDescription.cs

@@ -1,16 +0,0 @@
-using System;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-{
-    /// <summary>
-    /// Describes a type model.
-    /// </summary>
-    public abstract class ModelDescription
-    {
-        public string Documentation { get; set; }
-
-        public Type ModelType { get; set; }
-
-        public string Name { get; set; }
-    }
-}

+ 0 - 449
EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/ModelDescriptionGenerator.cs

@@ -1,449 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.Specialized;
-using System.ComponentModel.DataAnnotations;
-using System.Globalization;
-using System.Reflection;
-using System.Runtime.Serialization;
-using System.Xml.Serialization;
-using Newtonsoft.Json;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-{
-    /// <summary>
-    /// Generates model descriptions for given types.
-    /// </summary>
-    public class ModelDescriptionGenerator
-    {
-        // Modify this to support more data annotation attributes.
-        private readonly IDictionary<Type, Func<object, string>> AnnotationTextGenerator = new Dictionary<Type, Func<object, string>>
-        {
-            { typeof(RequiredAttribute), a => "Required" },
-            { typeof(RangeAttribute), a =>
-                {
-                    RangeAttribute range = (RangeAttribute)a;
-                    return String.Format(CultureInfo.CurrentCulture, "Range: inclusive between {0} and {1}", range.Minimum, range.Maximum);
-                }
-            },
-            { typeof(MaxLengthAttribute), a =>
-                {
-                    MaxLengthAttribute maxLength = (MaxLengthAttribute)a;
-                    return String.Format(CultureInfo.CurrentCulture, "Max length: {0}", maxLength.Length);
-                }
-            },
-            { typeof(MinLengthAttribute), a =>
-                {
-                    MinLengthAttribute minLength = (MinLengthAttribute)a;
-                    return String.Format(CultureInfo.CurrentCulture, "Min length: {0}", minLength.Length);
-                }
-            },
-            { typeof(StringLengthAttribute), a =>
-                {
-                    StringLengthAttribute strLength = (StringLengthAttribute)a;
-                    return String.Format(CultureInfo.CurrentCulture, "String length: inclusive between {0} and {1}", strLength.MinimumLength, strLength.MaximumLength);
-                }
-            },
-            { typeof(DataTypeAttribute), a =>
-                {
-                    DataTypeAttribute dataType = (DataTypeAttribute)a;
-                    return String.Format(CultureInfo.CurrentCulture, "Data type: {0}", dataType.CustomDataType ?? dataType.DataType.ToString());
-                }
-            },
-            { typeof(RegularExpressionAttribute), a =>
-                {
-                    RegularExpressionAttribute regularExpression = (RegularExpressionAttribute)a;
-                    return String.Format(CultureInfo.CurrentCulture, "Matching regular expression pattern: {0}", regularExpression.Pattern);
-                }
-            },
-        };
-
-        // Modify this to add more default documentations.
-        private readonly IDictionary<Type, string> DefaultTypeDocumentation = new Dictionary<Type, string>
-        {
-            { typeof(Int16), "integer" },
-            { typeof(Int32), "integer" },
-            { typeof(Int64), "integer" },
-            { typeof(UInt16), "unsigned integer" },
-            { typeof(UInt32), "unsigned integer" },
-            { typeof(UInt64), "unsigned integer" },
-            { typeof(Byte), "byte" },
-            { typeof(Char), "character" },
-            { typeof(SByte), "signed byte" },
-            { typeof(Uri), "URI" },
-            { typeof(Single), "decimal number" },
-            { typeof(Double), "decimal number" },
-            { typeof(Decimal), "decimal number" },
-            { typeof(String), "string" },
-            { typeof(Guid), "globally unique identifier" },
-            { typeof(TimeSpan), "time interval" },
-            { typeof(DateTime), "date" },
-            { typeof(DateTimeOffset), "date" },
-            { typeof(Boolean), "boolean" },
-        };
-
-        private Lazy<IModelDocumentationProvider> _documentationProvider;
-
-        public ModelDescriptionGenerator(HttpConfiguration config)
-        {
-            if (config == null)
-            {
-                throw new ArgumentNullException("config");
-            }
-
-            _documentationProvider = new Lazy<IModelDocumentationProvider>(() => config.Services.GetDocumentationProvider() as IModelDocumentationProvider);
-            GeneratedModels = new Dictionary<string, ModelDescription>(StringComparer.OrdinalIgnoreCase);
-        }
-
-        public Dictionary<string, ModelDescription> GeneratedModels { get; private set; }
-
-        private IModelDocumentationProvider DocumentationProvider
-        {
-            get
-            {
-                return _documentationProvider.Value;
-            }
-        }
-
-        public ModelDescription GetOrCreateModelDescription(Type modelType)
-        {
-            if (modelType == null)
-            {
-                throw new ArgumentNullException("modelType");
-            }
-
-            Type underlyingType = Nullable.GetUnderlyingType(modelType);
-            if (underlyingType != null)
-            {
-                modelType = underlyingType;
-            }
-
-            ModelDescription modelDescription;
-            string modelName = ModelNameHelper.GetModelName(modelType);
-            if (GeneratedModels.TryGetValue(modelName, out modelDescription))
-            {
-                if (modelType != modelDescription.ModelType)
-                {
-                    throw new InvalidOperationException(
-                        String.Format(
-                            CultureInfo.CurrentCulture,
-                            "A model description could not be created. Duplicate model name '{0}' was found for types '{1}' and '{2}'. " +
-                            "Use the [ModelName] attribute to change the model name for at least one of the types so that it has a unique name.",
-                            modelName,
-                            modelDescription.ModelType.FullName,
-                            modelType.FullName));
-                }
-
-                return modelDescription;
-            }
-
-            if (DefaultTypeDocumentation.ContainsKey(modelType))
-            {
-                return GenerateSimpleTypeModelDescription(modelType);
-            }
-
-            if (modelType.IsEnum)
-            {
-                return GenerateEnumTypeModelDescription(modelType);
-            }
-
-            if (modelType.IsGenericType)
-            {
-                Type[] genericArguments = modelType.GetGenericArguments();
-
-                if (genericArguments.Length == 1)
-                {
-                    Type enumerableType = typeof(IEnumerable<>).MakeGenericType(genericArguments);
-                    if (enumerableType.IsAssignableFrom(modelType))
-                    {
-                        return GenerateCollectionModelDescription(modelType, genericArguments[0]);
-                    }
-                }
-                if (genericArguments.Length == 2)
-                {
-                    Type dictionaryType = typeof(IDictionary<,>).MakeGenericType(genericArguments);
-                    if (dictionaryType.IsAssignableFrom(modelType))
-                    {
-                        return GenerateDictionaryModelDescription(modelType, genericArguments[0], genericArguments[1]);
-                    }
-
-                    Type keyValuePairType = typeof(KeyValuePair<,>).MakeGenericType(genericArguments);
-                    if (keyValuePairType.IsAssignableFrom(modelType))
-                    {
-                        return GenerateKeyValuePairModelDescription(modelType, genericArguments[0], genericArguments[1]);
-                    }
-                }
-            }
-
-            if (modelType.IsArray)
-            {
-                Type elementType = modelType.GetElementType();
-                return GenerateCollectionModelDescription(modelType, elementType);
-            }
-
-            if (modelType == typeof(NameValueCollection))
-            {
-                return GenerateDictionaryModelDescription(modelType, typeof(string), typeof(string));
-            }
-
-            if (typeof(IDictionary).IsAssignableFrom(modelType))
-            {
-                return GenerateDictionaryModelDescription(modelType, typeof(object), typeof(object));
-            }
-
-            if (typeof(IEnumerable).IsAssignableFrom(modelType))
-            {
-                return GenerateCollectionModelDescription(modelType, typeof(object));
-            }
-
-            return GenerateComplexTypeModelDescription(modelType);
-        }
-
-        // Change this to provide different name for the member.
-        private static string GetMemberName(MemberInfo member, bool hasDataContractAttribute)
-        {
-            JsonPropertyAttribute jsonProperty = member.GetCustomAttribute<JsonPropertyAttribute>();
-            if (jsonProperty != null && !String.IsNullOrEmpty(jsonProperty.PropertyName))
-            {
-                return jsonProperty.PropertyName;
-            }
-
-            if (hasDataContractAttribute)
-            {
-                DataMemberAttribute dataMember = member.GetCustomAttribute<DataMemberAttribute>();
-                if (dataMember != null && !String.IsNullOrEmpty(dataMember.Name))
-                {
-                    return dataMember.Name;
-                }
-            }
-
-            return member.Name;
-        }
-
-        private static bool ShouldDisplayMember(MemberInfo member, bool hasDataContractAttribute)
-        {
-            JsonIgnoreAttribute jsonIgnore = member.GetCustomAttribute<JsonIgnoreAttribute>();
-            XmlIgnoreAttribute xmlIgnore = member.GetCustomAttribute<XmlIgnoreAttribute>();
-            IgnoreDataMemberAttribute ignoreDataMember = member.GetCustomAttribute<IgnoreDataMemberAttribute>();
-            NonSerializedAttribute nonSerialized = member.GetCustomAttribute<NonSerializedAttribute>();
-            ApiExplorerSettingsAttribute apiExplorerSetting = member.GetCustomAttribute<ApiExplorerSettingsAttribute>();
-
-            bool hasMemberAttribute = member.DeclaringType.IsEnum ?
-                member.GetCustomAttribute<EnumMemberAttribute>() != null :
-                member.GetCustomAttribute<DataMemberAttribute>() != null;
-
-            // Display member only if all the followings are true:
-            // no JsonIgnoreAttribute
-            // no XmlIgnoreAttribute
-            // no IgnoreDataMemberAttribute
-            // no NonSerializedAttribute
-            // no ApiExplorerSettingsAttribute with IgnoreApi set to true
-            // no DataContractAttribute without DataMemberAttribute or EnumMemberAttribute
-            return jsonIgnore == null &&
-                xmlIgnore == null &&
-                ignoreDataMember == null &&
-                nonSerialized == null &&
-                (apiExplorerSetting == null || !apiExplorerSetting.IgnoreApi) &&
-                (!hasDataContractAttribute || hasMemberAttribute);
-        }
-
-        private string CreateDefaultDocumentation(Type type)
-        {
-            string documentation;
-            if (DefaultTypeDocumentation.TryGetValue(type, out documentation))
-            {
-                return documentation;
-            }
-            if (DocumentationProvider != null)
-            {
-                documentation = DocumentationProvider.GetDocumentation(type);
-            }
-
-            return documentation;
-        }
-
-        private void GenerateAnnotations(MemberInfo property, ParameterDescription propertyModel)
-        {
-            List<ParameterAnnotation> annotations = new List<ParameterAnnotation>();
-
-            IEnumerable<Attribute> attributes = property.GetCustomAttributes();
-            foreach (Attribute attribute in attributes)
-            {
-                Func<object, string> textGenerator;
-                if (AnnotationTextGenerator.TryGetValue(attribute.GetType(), out textGenerator))
-                {
-                    annotations.Add(
-                        new ParameterAnnotation
-                        {
-                            AnnotationAttribute = attribute,
-                            Documentation = textGenerator(attribute)
-                        });
-                }
-            }
-
-            // Rearrange the annotations
-            annotations.Sort((x, y) =>
-            {
-                // Special-case RequiredAttribute so that it shows up on top
-                if (x.AnnotationAttribute is RequiredAttribute)
-                {
-                    return -1;
-                }
-                if (y.AnnotationAttribute is RequiredAttribute)
-                {
-                    return 1;
-                }
-
-                // Sort the rest based on alphabetic order of the documentation
-                return String.Compare(x.Documentation, y.Documentation, StringComparison.OrdinalIgnoreCase);
-            });
-
-            foreach (ParameterAnnotation annotation in annotations)
-            {
-                propertyModel.Annotations.Add(annotation);
-            }
-        }
-
-        private CollectionModelDescription GenerateCollectionModelDescription(Type modelType, Type elementType)
-        {
-            ModelDescription collectionModelDescription = GetOrCreateModelDescription(elementType);
-            if (collectionModelDescription != null)
-            {
-                return new CollectionModelDescription
-                {
-                    Name = ModelNameHelper.GetModelName(modelType),
-                    ModelType = modelType,
-                    ElementDescription = collectionModelDescription
-                };
-            }
-
-            return null;
-        }
-
-        private ModelDescription GenerateComplexTypeModelDescription(Type modelType)
-        {
-            ComplexTypeModelDescription complexModelDescription = new ComplexTypeModelDescription
-            {
-                Name = ModelNameHelper.GetModelName(modelType),
-                ModelType = modelType,
-                Documentation = CreateDefaultDocumentation(modelType)
-            };
-
-            GeneratedModels.Add(complexModelDescription.Name, complexModelDescription);
-            bool hasDataContractAttribute = modelType.GetCustomAttribute<DataContractAttribute>() != null;
-            PropertyInfo[] properties = modelType.GetProperties(BindingFlags.Public | BindingFlags.Instance);
-            foreach (PropertyInfo property in properties)
-            {
-                if (ShouldDisplayMember(property, hasDataContractAttribute))
-                {
-                    ParameterDescription propertyModel = new ParameterDescription
-                    {
-                        Name = GetMemberName(property, hasDataContractAttribute)
-                    };
-
-                    if (DocumentationProvider != null)
-                    {
-                        propertyModel.Documentation = DocumentationProvider.GetDocumentation(property);
-                    }
-
-                    GenerateAnnotations(property, propertyModel);
-                    complexModelDescription.Properties.Add(propertyModel);
-                    propertyModel.TypeDescription = GetOrCreateModelDescription(property.PropertyType);
-                }
-            }
-
-            FieldInfo[] fields = modelType.GetFields(BindingFlags.Public | BindingFlags.Instance);
-            foreach (FieldInfo field in fields)
-            {
-                if (ShouldDisplayMember(field, hasDataContractAttribute))
-                {
-                    ParameterDescription propertyModel = new ParameterDescription
-                    {
-                        Name = GetMemberName(field, hasDataContractAttribute)
-                    };
-
-                    if (DocumentationProvider != null)
-                    {
-                        propertyModel.Documentation = DocumentationProvider.GetDocumentation(field);
-                    }
-
-                    complexModelDescription.Properties.Add(propertyModel);
-                    propertyModel.TypeDescription = GetOrCreateModelDescription(field.FieldType);
-                }
-            }
-
-            return complexModelDescription;
-        }
-
-        private DictionaryModelDescription GenerateDictionaryModelDescription(Type modelType, Type keyType, Type valueType)
-        {
-            ModelDescription keyModelDescription = GetOrCreateModelDescription(keyType);
-            ModelDescription valueModelDescription = GetOrCreateModelDescription(valueType);
-
-            return new DictionaryModelDescription
-            {
-                Name = ModelNameHelper.GetModelName(modelType),
-                ModelType = modelType,
-                KeyModelDescription = keyModelDescription,
-                ValueModelDescription = valueModelDescription
-            };
-        }
-
-        private EnumTypeModelDescription GenerateEnumTypeModelDescription(Type modelType)
-        {
-            EnumTypeModelDescription enumDescription = new EnumTypeModelDescription
-            {
-                Name = ModelNameHelper.GetModelName(modelType),
-                ModelType = modelType,
-                Documentation = CreateDefaultDocumentation(modelType)
-            };
-            bool hasDataContractAttribute = modelType.GetCustomAttribute<DataContractAttribute>() != null;
-            foreach (FieldInfo field in modelType.GetFields(BindingFlags.Public | BindingFlags.Static))
-            {
-                if (ShouldDisplayMember(field, hasDataContractAttribute))
-                {
-                    EnumValueDescription enumValue = new EnumValueDescription
-                    {
-                        Name = field.Name,
-                        Value = field.GetRawConstantValue().ToString()
-                    };
-                    if (DocumentationProvider != null)
-                    {
-                        enumValue.Documentation = DocumentationProvider.GetDocumentation(field);
-                    }
-                    enumDescription.Values.Add(enumValue);
-                }
-            }
-            GeneratedModels.Add(enumDescription.Name, enumDescription);
-
-            return enumDescription;
-        }
-
-        private KeyValuePairModelDescription GenerateKeyValuePairModelDescription(Type modelType, Type keyType, Type valueType)
-        {
-            ModelDescription keyModelDescription = GetOrCreateModelDescription(keyType);
-            ModelDescription valueModelDescription = GetOrCreateModelDescription(valueType);
-
-            return new KeyValuePairModelDescription
-            {
-                Name = ModelNameHelper.GetModelName(modelType),
-                ModelType = modelType,
-                KeyModelDescription = keyModelDescription,
-                ValueModelDescription = valueModelDescription
-            };
-        }
-
-        private ModelDescription GenerateSimpleTypeModelDescription(Type modelType)
-        {
-            SimpleTypeModelDescription simpleModelDescription = new SimpleTypeModelDescription
-            {
-                Name = ModelNameHelper.GetModelName(modelType),
-                ModelType = modelType,
-                Documentation = CreateDefaultDocumentation(modelType)
-            };
-            GeneratedModels.Add(simpleModelDescription.Name, simpleModelDescription);
-
-            return simpleModelDescription;
-        }
-    }
-}

+ 0 - 18
EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/ModelNameAttribute.cs

@@ -1,18 +0,0 @@
-using System;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-{
-    /// <summary>
-    /// Use this attribute to change the name of the <see cref="ModelDescription"/> generated for a type.
-    /// </summary>
-    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum, AllowMultiple = false, Inherited = false)]
-    public sealed class ModelNameAttribute : Attribute
-    {
-        public ModelNameAttribute(string name)
-        {
-            Name = name;
-        }
-
-        public string Name { get; private set; }
-    }
-}

+ 0 - 36
EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/ModelNameHelper.cs

@@ -1,36 +0,0 @@
-using System;
-using System.Globalization;
-using System.Linq;
-using System.Reflection;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-{
-    internal static class ModelNameHelper
-    {
-        // Modify this to provide custom model name mapping.
-        public static string GetModelName(Type type)
-        {
-            ModelNameAttribute modelNameAttribute = type.GetCustomAttribute<ModelNameAttribute>();
-            if (modelNameAttribute != null && !String.IsNullOrEmpty(modelNameAttribute.Name))
-            {
-                return modelNameAttribute.Name;
-            }
-
-            string modelName = type.Name;
-            if (type.IsGenericType)
-            {
-                // Format the generic type name to something like: GenericOfAgurment1AndArgument2
-                Type genericType = type.GetGenericTypeDefinition();
-                Type[] genericArguments = type.GetGenericArguments();
-                string genericTypeName = genericType.Name;
-
-                // Trim the generic parameter counts from the name
-                genericTypeName = genericTypeName.Substring(0, genericTypeName.IndexOf('`'));
-                string[] argumentTypeNames = genericArguments.Select(t => GetModelName(t)).ToArray();
-                modelName = String.Format(CultureInfo.InvariantCulture, "{0}Of{1}", genericTypeName, String.Join("And", argumentTypeNames));
-            }
-
-            return modelName;
-        }
-    }
-}

+ 0 - 11
EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/ParameterAnnotation.cs

@@ -1,11 +0,0 @@
-using System;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-{
-    public class ParameterAnnotation
-    {
-        public Attribute AnnotationAttribute { get; set; }
-
-        public string Documentation { get; set; }
-    }
-}

+ 0 - 21
EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/ParameterDescription.cs

@@ -1,21 +0,0 @@
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-{
-    public class ParameterDescription
-    {
-        public ParameterDescription()
-        {
-            Annotations = new Collection<ParameterAnnotation>();
-        }
-
-        public Collection<ParameterAnnotation> Annotations { get; private set; }
-
-        public string Documentation { get; set; }
-
-        public string Name { get; set; }
-
-        public ModelDescription TypeDescription { get; set; }
-    }
-}

+ 0 - 6
EVCB_OCPP.WEBAPI/Areas/HelpPage/ModelDescriptions/SimpleTypeModelDescription.cs

@@ -1,6 +0,0 @@
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-{
-    public class SimpleTypeModelDescription : ModelDescription
-    {
-    }
-}

+ 0 - 107
EVCB_OCPP.WEBAPI/Areas/HelpPage/Models/HelpPageApiModel.cs

@@ -1,107 +0,0 @@
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Net.Http.Headers;
-using EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage.Models
-{
-    /// <summary>
-    /// The model that represents an API displayed on the help page.
-    /// </summary>
-    public class HelpPageApiModel
-    {
-        /// <summary>
-        /// Initializes a new instance of the <see cref="HelpPageApiModel"/> class.
-        /// </summary>
-        public HelpPageApiModel()
-        {
-            UriParameters = new Collection<ParameterDescription>();
-            SampleRequests = new Dictionary<MediaTypeHeaderValue, object>();
-            SampleResponses = new Dictionary<MediaTypeHeaderValue, object>();
-            ErrorMessages = new Collection<string>();
-        }
-
-        /// <summary>
-        /// Gets or sets the <see cref="ApiDescription"/> that describes the API.
-        /// </summary>
-        public ApiDescription ApiDescription { get; set; }
-
-        /// <summary>
-        /// Gets or sets the <see cref="ParameterDescription"/> collection that describes the URI parameters for the API.
-        /// </summary>
-        public Collection<ParameterDescription> UriParameters { get; private set; }
-
-        /// <summary>
-        /// Gets or sets the documentation for the request.
-        /// </summary>
-        public string RequestDocumentation { get; set; }
-
-        /// <summary>
-        /// Gets or sets the <see cref="ModelDescription"/> that describes the request body.
-        /// </summary>
-        public ModelDescription RequestModelDescription { get; set; }
-
-        /// <summary>
-        /// Gets the request body parameter descriptions.
-        /// </summary>
-        public IList<ParameterDescription> RequestBodyParameters
-        {
-            get
-            {
-                return GetParameterDescriptions(RequestModelDescription);
-            }
-        }
-
-        /// <summary>
-        /// Gets or sets the <see cref="ModelDescription"/> that describes the resource.
-        /// </summary>
-        public ModelDescription ResourceDescription { get; set; }
-
-        /// <summary>
-        /// Gets the resource property descriptions.
-        /// </summary>
-        public IList<ParameterDescription> ResourceProperties
-        {
-            get
-            {
-                return GetParameterDescriptions(ResourceDescription);
-            }
-        }
-
-        /// <summary>
-        /// Gets the sample requests associated with the API.
-        /// </summary>
-        public IDictionary<MediaTypeHeaderValue, object> SampleRequests { get; private set; }
-
-        /// <summary>
-        /// Gets the sample responses associated with the API.
-        /// </summary>
-        public IDictionary<MediaTypeHeaderValue, object> SampleResponses { get; private set; }
-
-        /// <summary>
-        /// Gets the error messages associated with this model.
-        /// </summary>
-        public Collection<string> ErrorMessages { get; private set; }
-
-        private static IList<ParameterDescription> GetParameterDescriptions(ModelDescription modelDescription)
-        {
-            ComplexTypeModelDescription complexTypeModelDescription = modelDescription as ComplexTypeModelDescription;
-            if (complexTypeModelDescription != null)
-            {
-                return complexTypeModelDescription.Properties;
-            }
-
-            CollectionModelDescription collectionModelDescription = modelDescription as CollectionModelDescription;
-            if (collectionModelDescription != null)
-            {
-                complexTypeModelDescription = collectionModelDescription.ElementDescription as ComplexTypeModelDescription;
-                if (complexTypeModelDescription != null)
-                {
-                    return complexTypeModelDescription.Properties;
-                }
-            }
-
-            return null;
-        }
-    }
-}

+ 0 - 443
EVCB_OCPP.WEBAPI/Areas/HelpPage/SampleGeneration/HelpPageSampleGenerator.cs

@@ -1,443 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.Diagnostics.CodeAnalysis;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Net.Http;
-using System.Net.Http.Formatting;
-using System.Net.Http.Headers;
-using System.Xml.Linq;
-using Newtonsoft.Json;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage
-{
-    /// <summary>
-    /// This class will generate the samples for the help page.
-    /// </summary>
-    public class HelpPageSampleGenerator
-    {
-        /// <summary>
-        /// Initializes a new instance of the <see cref="HelpPageSampleGenerator"/> class.
-        /// </summary>
-        public HelpPageSampleGenerator()
-        {
-            ActualHttpMessageTypes = new Dictionary<HelpPageSampleKey, Type>();
-            ActionSamples = new Dictionary<HelpPageSampleKey, object>();
-            SampleObjects = new Dictionary<Type, object>();
-            SampleObjectFactories = new List<Func<HelpPageSampleGenerator, Type, object>>
-            {
-                DefaultSampleObjectFactory,
-            };
-        }
-
-        /// <summary>
-        /// Gets CLR types that are used as the content of <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/>.
-        /// </summary>
-        public IDictionary<HelpPageSampleKey, Type> ActualHttpMessageTypes { get; internal set; }
-
-        /// <summary>
-        /// Gets the objects that are used directly as samples for certain actions.
-        /// </summary>
-        public IDictionary<HelpPageSampleKey, object> ActionSamples { get; internal set; }
-
-        /// <summary>
-        /// Gets the objects that are serialized as samples by the supported formatters.
-        /// </summary>
-        public IDictionary<Type, object> SampleObjects { get; internal set; }
-
-        /// <summary>
-        /// Gets factories for the objects that the supported formatters will serialize as samples. Processed in order,
-        /// stopping when the factory successfully returns a non-<see langref="null"/> object.
-        /// </summary>
-        /// <remarks>
-        /// Collection includes just <see cref="ObjectGenerator.GenerateObject(Type)"/> initially. Use
-        /// <code>SampleObjectFactories.Insert(0, func)</code> to provide an override and
-        /// <code>SampleObjectFactories.Add(func)</code> to provide a fallback.</remarks>
-        [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures",
-            Justification = "This is an appropriate nesting of generic types")]
-        public IList<Func<HelpPageSampleGenerator, Type, object>> SampleObjectFactories { get; private set; }
-
-        /// <summary>
-        /// Gets the request body samples for a given <see cref="ApiDescription"/>.
-        /// </summary>
-        /// <param name="api">The <see cref="ApiDescription"/>.</param>
-        /// <returns>The samples keyed by media type.</returns>
-        public IDictionary<MediaTypeHeaderValue, object> GetSampleRequests(ApiDescription api)
-        {
-            return GetSample(api, SampleDirection.Request);
-        }
-
-        /// <summary>
-        /// Gets the response body samples for a given <see cref="ApiDescription"/>.
-        /// </summary>
-        /// <param name="api">The <see cref="ApiDescription"/>.</param>
-        /// <returns>The samples keyed by media type.</returns>
-        public IDictionary<MediaTypeHeaderValue, object> GetSampleResponses(ApiDescription api)
-        {
-            return GetSample(api, SampleDirection.Response);
-        }
-
-        /// <summary>
-        /// Gets the request or response body samples.
-        /// </summary>
-        /// <param name="api">The <see cref="ApiDescription"/>.</param>
-        /// <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param>
-        /// <returns>The samples keyed by media type.</returns>
-        public virtual IDictionary<MediaTypeHeaderValue, object> GetSample(ApiDescription api, SampleDirection sampleDirection)
-        {
-            if (api == null)
-            {
-                throw new ArgumentNullException("api");
-            }
-            string controllerName = api.ActionDescriptor.ControllerDescriptor.ControllerName;
-            string actionName = api.ActionDescriptor.ActionName;
-            IEnumerable<string> parameterNames = api.ParameterDescriptions.Select(p => p.Name);
-            Collection<MediaTypeFormatter> formatters;
-            Type type = ResolveType(api, controllerName, actionName, parameterNames, sampleDirection, out formatters);
-            var samples = new Dictionary<MediaTypeHeaderValue, object>();
-
-            // Use the samples provided directly for actions
-            var actionSamples = GetAllActionSamples(controllerName, actionName, parameterNames, sampleDirection);
-            foreach (var actionSample in actionSamples)
-            {
-                samples.Add(actionSample.Key.MediaType, WrapSampleIfString(actionSample.Value));
-            }
-
-            // Do the sample generation based on formatters only if an action doesn't return an HttpResponseMessage.
-            // Here we cannot rely on formatters because we don't know what's in the HttpResponseMessage, it might not even use formatters.
-            if (type != null && !typeof(HttpResponseMessage).IsAssignableFrom(type))
-            {
-                object sampleObject = GetSampleObject(type);
-                foreach (var formatter in formatters)
-                {
-                    foreach (MediaTypeHeaderValue mediaType in formatter.SupportedMediaTypes)
-                    {
-                        if (!samples.ContainsKey(mediaType))
-                        {
-                            object sample = GetActionSample(controllerName, actionName, parameterNames, type, formatter, mediaType, sampleDirection);
-
-                            // If no sample found, try generate sample using formatter and sample object
-                            if (sample == null && sampleObject != null)
-                            {
-                                sample = WriteSampleObjectUsingFormatter(formatter, sampleObject, type, mediaType);
-                            }
-
-                            samples.Add(mediaType, WrapSampleIfString(sample));
-                        }
-                    }
-                }
-            }
-
-            return samples;
-        }
-
-        /// <summary>
-        /// Search for samples that are provided directly through <see cref="ActionSamples"/>.
-        /// </summary>
-        /// <param name="controllerName">Name of the controller.</param>
-        /// <param name="actionName">Name of the action.</param>
-        /// <param name="parameterNames">The parameter names.</param>
-        /// <param name="type">The CLR type.</param>
-        /// <param name="formatter">The formatter.</param>
-        /// <param name="mediaType">The media type.</param>
-        /// <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param>
-        /// <returns>The sample that matches the parameters.</returns>
-        public virtual object GetActionSample(string controllerName, string actionName, IEnumerable<string> parameterNames, Type type, MediaTypeFormatter formatter, MediaTypeHeaderValue mediaType, SampleDirection sampleDirection)
-        {
-            object sample;
-
-            // First, try to get the sample provided for the specified mediaType, sampleDirection, controllerName, actionName and parameterNames.
-            // If not found, try to get the sample provided for the specified mediaType, sampleDirection, controllerName and actionName regardless of the parameterNames.
-            // If still not found, try to get the sample provided for the specified mediaType and type.
-            // Finally, try to get the sample provided for the specified mediaType.
-            if (ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, parameterNames), out sample) ||
-                ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, new[] { "*" }), out sample) ||
-                ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, type), out sample) ||
-                ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType), out sample))
-            {
-                return sample;
-            }
-
-            return null;
-        }
-
-        /// <summary>
-        /// Gets the sample object that will be serialized by the formatters. 
-        /// First, it will look at the <see cref="SampleObjects"/>. If no sample object is found, it will try to create
-        /// one using <see cref="DefaultSampleObjectFactory"/> (which wraps an <see cref="ObjectGenerator"/>) and other
-        /// factories in <see cref="SampleObjectFactories"/>.
-        /// </summary>
-        /// <param name="type">The type.</param>
-        /// <returns>The sample object.</returns>
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
-            Justification = "Even if all items in SampleObjectFactories throw, problem will be visible as missing sample.")]
-        public virtual object GetSampleObject(Type type)
-        {
-            object sampleObject;
-
-            if (!SampleObjects.TryGetValue(type, out sampleObject))
-            {
-                // No specific object available, try our factories.
-                foreach (Func<HelpPageSampleGenerator, Type, object> factory in SampleObjectFactories)
-                {
-                    if (factory == null)
-                    {
-                        continue;
-                    }
-
-                    try
-                    {
-                        sampleObject = factory(this, type);
-                        if (sampleObject != null)
-                        {
-                            break;
-                        }
-                    }
-                    catch
-                    {
-                        // Ignore any problems encountered in the factory; go on to the next one (if any).
-                    }
-                }
-            }
-
-            return sampleObject;
-        }
-
-        /// <summary>
-        /// Resolves the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> passed to the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
-        /// </summary>
-        /// <param name="api">The <see cref="ApiDescription"/>.</param>
-        /// <returns>The type.</returns>
-        public virtual Type ResolveHttpRequestMessageType(ApiDescription api)
-        {
-            string controllerName = api.ActionDescriptor.ControllerDescriptor.ControllerName;
-            string actionName = api.ActionDescriptor.ActionName;
-            IEnumerable<string> parameterNames = api.ParameterDescriptions.Select(p => p.Name);
-            Collection<MediaTypeFormatter> formatters;
-            return ResolveType(api, controllerName, actionName, parameterNames, SampleDirection.Request, out formatters);
-        }
-
-        /// <summary>
-        /// Resolves the type of the action parameter or return value when <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/> is used.
-        /// </summary>
-        /// <param name="api">The <see cref="ApiDescription"/>.</param>
-        /// <param name="controllerName">Name of the controller.</param>
-        /// <param name="actionName">Name of the action.</param>
-        /// <param name="parameterNames">The parameter names.</param>
-        /// <param name="sampleDirection">The value indicating whether the sample is for a request or a response.</param>
-        /// <param name="formatters">The formatters.</param>
-        [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", Justification = "This is only used in advanced scenarios.")]
-        public virtual Type ResolveType(ApiDescription api, string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection, out Collection<MediaTypeFormatter> formatters)
-        {
-            if (!Enum.IsDefined(typeof(SampleDirection), sampleDirection))
-            {
-                throw new InvalidEnumArgumentException("sampleDirection", (int)sampleDirection, typeof(SampleDirection));
-            }
-            if (api == null)
-            {
-                throw new ArgumentNullException("api");
-            }
-            Type type;
-            if (ActualHttpMessageTypes.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, parameterNames), out type) ||
-                ActualHttpMessageTypes.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, new[] { "*" }), out type))
-            {
-                // Re-compute the supported formatters based on type
-                Collection<MediaTypeFormatter> newFormatters = new Collection<MediaTypeFormatter>();
-                foreach (var formatter in api.ActionDescriptor.Configuration.Formatters)
-                {
-                    if (IsFormatSupported(sampleDirection, formatter, type))
-                    {
-                        newFormatters.Add(formatter);
-                    }
-                }
-                formatters = newFormatters;
-            }
-            else
-            {
-                switch (sampleDirection)
-                {
-                    case SampleDirection.Request:
-                        ApiParameterDescription requestBodyParameter = api.ParameterDescriptions.FirstOrDefault(p => p.Source == ApiParameterSource.FromBody);
-                        type = requestBodyParameter == null ? null : requestBodyParameter.ParameterDescriptor.ParameterType;
-                        formatters = api.SupportedRequestBodyFormatters;
-                        break;
-                    case SampleDirection.Response:
-                    default:
-                        type = api.ResponseDescription.ResponseType ?? api.ResponseDescription.DeclaredType;
-                        formatters = api.SupportedResponseFormatters;
-                        break;
-                }
-            }
-
-            return type;
-        }
-
-        /// <summary>
-        /// Writes the sample object using formatter.
-        /// </summary>
-        /// <param name="formatter">The formatter.</param>
-        /// <param name="value">The value.</param>
-        /// <param name="type">The type.</param>
-        /// <param name="mediaType">Type of the media.</param>
-        /// <returns></returns>
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is recorded as InvalidSample.")]
-        public virtual object WriteSampleObjectUsingFormatter(MediaTypeFormatter formatter, object value, Type type, MediaTypeHeaderValue mediaType)
-        {
-            if (formatter == null)
-            {
-                throw new ArgumentNullException("formatter");
-            }
-            if (mediaType == null)
-            {
-                throw new ArgumentNullException("mediaType");
-            }
-
-            object sample = String.Empty;
-            MemoryStream ms = null;
-            HttpContent content = null;
-            try
-            {
-                if (formatter.CanWriteType(type))
-                {
-                    ms = new MemoryStream();
-                    content = new ObjectContent(type, value, formatter, mediaType);
-                    formatter.WriteToStreamAsync(type, value, ms, content, null).Wait();
-                    ms.Position = 0;
-                    StreamReader reader = new StreamReader(ms);
-                    string serializedSampleString = reader.ReadToEnd();
-                    if (mediaType.MediaType.ToUpperInvariant().Contains("XML"))
-                    {
-                        serializedSampleString = TryFormatXml(serializedSampleString);
-                    }
-                    else if (mediaType.MediaType.ToUpperInvariant().Contains("JSON"))
-                    {
-                        serializedSampleString = TryFormatJson(serializedSampleString);
-                    }
-
-                    sample = new TextSample(serializedSampleString);
-                }
-                else
-                {
-                    sample = new InvalidSample(String.Format(
-                        CultureInfo.CurrentCulture,
-                        "Failed to generate the sample for media type '{0}'. Cannot use formatter '{1}' to write type '{2}'.",
-                        mediaType,
-                        formatter.GetType().Name,
-                        type.Name));
-                }
-            }
-            catch (Exception e)
-            {
-                sample = new InvalidSample(String.Format(
-                    CultureInfo.CurrentCulture,
-                    "An exception has occurred while using the formatter '{0}' to generate sample for media type '{1}'. Exception message: {2}",
-                    formatter.GetType().Name,
-                    mediaType.MediaType,
-                    UnwrapException(e).Message));
-            }
-            finally
-            {
-                if (ms != null)
-                {
-                    ms.Dispose();
-                }
-                if (content != null)
-                {
-                    content.Dispose();
-                }
-            }
-
-            return sample;
-        }
-
-        internal static Exception UnwrapException(Exception exception)
-        {
-            AggregateException aggregateException = exception as AggregateException;
-            if (aggregateException != null)
-            {
-                return aggregateException.Flatten().InnerException;
-            }
-            return exception;
-        }
-
-        // Default factory for sample objects
-        private static object DefaultSampleObjectFactory(HelpPageSampleGenerator sampleGenerator, Type type)
-        {
-            // Try to create a default sample object
-            ObjectGenerator objectGenerator = new ObjectGenerator();
-            return objectGenerator.GenerateObject(type);
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")]
-        private static string TryFormatJson(string str)
-        {
-            try
-            {
-                object parsedJson = JsonConvert.DeserializeObject(str);
-                return JsonConvert.SerializeObject(parsedJson, Formatting.Indented);
-            }
-            catch
-            {
-                // can't parse JSON, return the original string
-                return str;
-            }
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")]
-        private static string TryFormatXml(string str)
-        {
-            try
-            {
-                XDocument xml = XDocument.Parse(str);
-                return xml.ToString();
-            }
-            catch
-            {
-                // can't parse XML, return the original string
-                return str;
-            }
-        }
-
-        private static bool IsFormatSupported(SampleDirection sampleDirection, MediaTypeFormatter formatter, Type type)
-        {
-            switch (sampleDirection)
-            {
-                case SampleDirection.Request:
-                    return formatter.CanReadType(type);
-                case SampleDirection.Response:
-                    return formatter.CanWriteType(type);
-            }
-            return false;
-        }
-
-        private IEnumerable<KeyValuePair<HelpPageSampleKey, object>> GetAllActionSamples(string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection)
-        {
-            HashSet<string> parameterNamesSet = new HashSet<string>(parameterNames, StringComparer.OrdinalIgnoreCase);
-            foreach (var sample in ActionSamples)
-            {
-                HelpPageSampleKey sampleKey = sample.Key;
-                if (String.Equals(controllerName, sampleKey.ControllerName, StringComparison.OrdinalIgnoreCase) &&
-                    String.Equals(actionName, sampleKey.ActionName, StringComparison.OrdinalIgnoreCase) &&
-                    (sampleKey.ParameterNames.SetEquals(new[] { "*" }) || parameterNamesSet.SetEquals(sampleKey.ParameterNames)) &&
-                    sampleDirection == sampleKey.SampleDirection)
-                {
-                    yield return sample;
-                }
-            }
-        }
-
-        private static object WrapSampleIfString(object sample)
-        {
-            string stringSample = sample as string;
-            if (stringSample != null)
-            {
-                return new TextSample(stringSample);
-            }
-
-            return sample;
-        }
-    }
-}

+ 0 - 172
EVCB_OCPP.WEBAPI/Areas/HelpPage/SampleGeneration/HelpPageSampleKey.cs

@@ -1,172 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Net.Http.Headers;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage
-{
-    /// <summary>
-    /// This is used to identify the place where the sample should be applied.
-    /// </summary>
-    public class HelpPageSampleKey
-    {
-        /// <summary>
-        /// Creates a new <see cref="HelpPageSampleKey"/> based on media type.
-        /// </summary>
-        /// <param name="mediaType">The media type.</param>
-        public HelpPageSampleKey(MediaTypeHeaderValue mediaType)
-        {
-            if (mediaType == null)
-            {
-                throw new ArgumentNullException("mediaType");
-            }
-
-            ActionName = String.Empty;
-            ControllerName = String.Empty;
-            MediaType = mediaType;
-            ParameterNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
-        }
-
-        /// <summary>
-        /// Creates a new <see cref="HelpPageSampleKey"/> based on media type and CLR type.
-        /// </summary>
-        /// <param name="mediaType">The media type.</param>
-        /// <param name="type">The CLR type.</param>
-        public HelpPageSampleKey(MediaTypeHeaderValue mediaType, Type type)
-            : this(mediaType)
-        {
-            if (type == null)
-            {
-                throw new ArgumentNullException("type");
-            }
-
-            ParameterType = type;
-        }
-
-        /// <summary>
-        /// Creates a new <see cref="HelpPageSampleKey"/> based on <see cref="SampleDirection"/>, controller name, action name and parameter names.
-        /// </summary>
-        /// <param name="sampleDirection">The <see cref="SampleDirection"/>.</param>
-        /// <param name="controllerName">Name of the controller.</param>
-        /// <param name="actionName">Name of the action.</param>
-        /// <param name="parameterNames">The parameter names.</param>
-        public HelpPageSampleKey(SampleDirection sampleDirection, string controllerName, string actionName, IEnumerable<string> parameterNames)
-        {
-            if (!Enum.IsDefined(typeof(SampleDirection), sampleDirection))
-            {
-                throw new InvalidEnumArgumentException("sampleDirection", (int)sampleDirection, typeof(SampleDirection));
-            }
-            if (controllerName == null)
-            {
-                throw new ArgumentNullException("controllerName");
-            }
-            if (actionName == null)
-            {
-                throw new ArgumentNullException("actionName");
-            }
-            if (parameterNames == null)
-            {
-                throw new ArgumentNullException("parameterNames");
-            }
-
-            ControllerName = controllerName;
-            ActionName = actionName;
-            ParameterNames = new HashSet<string>(parameterNames, StringComparer.OrdinalIgnoreCase);
-            SampleDirection = sampleDirection;
-        }
-
-        /// <summary>
-        /// Creates a new <see cref="HelpPageSampleKey"/> based on media type, <see cref="SampleDirection"/>, controller name, action name and parameter names.
-        /// </summary>
-        /// <param name="mediaType">The media type.</param>
-        /// <param name="sampleDirection">The <see cref="SampleDirection"/>.</param>
-        /// <param name="controllerName">Name of the controller.</param>
-        /// <param name="actionName">Name of the action.</param>
-        /// <param name="parameterNames">The parameter names.</param>
-        public HelpPageSampleKey(MediaTypeHeaderValue mediaType, SampleDirection sampleDirection, string controllerName, string actionName, IEnumerable<string> parameterNames)
-            : this(sampleDirection, controllerName, actionName, parameterNames)
-        {
-            if (mediaType == null)
-            {
-                throw new ArgumentNullException("mediaType");
-            }
-
-            MediaType = mediaType;
-        }
-
-        /// <summary>
-        /// Gets the name of the controller.
-        /// </summary>
-        /// <value>
-        /// The name of the controller.
-        /// </value>
-        public string ControllerName { get; private set; }
-
-        /// <summary>
-        /// Gets the name of the action.
-        /// </summary>
-        /// <value>
-        /// The name of the action.
-        /// </value>
-        public string ActionName { get; private set; }
-
-        /// <summary>
-        /// Gets the media type.
-        /// </summary>
-        /// <value>
-        /// The media type.
-        /// </value>
-        public MediaTypeHeaderValue MediaType { get; private set; }
-
-        /// <summary>
-        /// Gets the parameter names.
-        /// </summary>
-        public HashSet<string> ParameterNames { get; private set; }
-
-        public Type ParameterType { get; private set; }
-
-        /// <summary>
-        /// Gets the <see cref="SampleDirection"/>.
-        /// </summary>
-        public SampleDirection? SampleDirection { get; private set; }
-
-        public override bool Equals(object obj)
-        {
-            HelpPageSampleKey otherKey = obj as HelpPageSampleKey;
-            if (otherKey == null)
-            {
-                return false;
-            }
-
-            return String.Equals(ControllerName, otherKey.ControllerName, StringComparison.OrdinalIgnoreCase) &&
-                String.Equals(ActionName, otherKey.ActionName, StringComparison.OrdinalIgnoreCase) &&
-                (MediaType == otherKey.MediaType || (MediaType != null && MediaType.Equals(otherKey.MediaType))) &&
-                ParameterType == otherKey.ParameterType &&
-                SampleDirection == otherKey.SampleDirection &&
-                ParameterNames.SetEquals(otherKey.ParameterNames);
-        }
-
-        public override int GetHashCode()
-        {
-            int hashCode = ControllerName.ToUpperInvariant().GetHashCode() ^ ActionName.ToUpperInvariant().GetHashCode();
-            if (MediaType != null)
-            {
-                hashCode ^= MediaType.GetHashCode();
-            }
-            if (SampleDirection != null)
-            {
-                hashCode ^= SampleDirection.GetHashCode();
-            }
-            if (ParameterType != null)
-            {
-                hashCode ^= ParameterType.GetHashCode();
-            }
-            foreach (string parameterName in ParameterNames)
-            {
-                hashCode ^= parameterName.ToUpperInvariant().GetHashCode();
-            }
-
-            return hashCode;
-        }
-    }
-}

+ 0 - 41
EVCB_OCPP.WEBAPI/Areas/HelpPage/SampleGeneration/ImageSample.cs

@@ -1,41 +0,0 @@
-using System;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage
-{
-    /// <summary>
-    /// This represents an image sample on the help page. There's a display template named ImageSample associated with this class.
-    /// </summary>
-    public class ImageSample
-    {
-        /// <summary>
-        /// Initializes a new instance of the <see cref="ImageSample"/> class.
-        /// </summary>
-        /// <param name="src">The URL of an image.</param>
-        public ImageSample(string src)
-        {
-            if (src == null)
-            {
-                throw new ArgumentNullException("src");
-            }
-            Src = src;
-        }
-
-        public string Src { get; private set; }
-
-        public override bool Equals(object obj)
-        {
-            ImageSample other = obj as ImageSample;
-            return other != null && Src == other.Src;
-        }
-
-        public override int GetHashCode()
-        {
-            return Src.GetHashCode();
-        }
-
-        public override string ToString()
-        {
-            return Src;
-        }
-    }
-}

+ 0 - 37
EVCB_OCPP.WEBAPI/Areas/HelpPage/SampleGeneration/InvalidSample.cs

@@ -1,37 +0,0 @@
-using System;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage
-{
-    /// <summary>
-    /// This represents an invalid sample on the help page. There's a display template named InvalidSample associated with this class.
-    /// </summary>
-    public class InvalidSample
-    {
-        public InvalidSample(string errorMessage)
-        {
-            if (errorMessage == null)
-            {
-                throw new ArgumentNullException("errorMessage");
-            }
-            ErrorMessage = errorMessage;
-        }
-
-        public string ErrorMessage { get; private set; }
-
-        public override bool Equals(object obj)
-        {
-            InvalidSample other = obj as InvalidSample;
-            return other != null && ErrorMessage == other.ErrorMessage;
-        }
-
-        public override int GetHashCode()
-        {
-            return ErrorMessage.GetHashCode();
-        }
-
-        public override string ToString()
-        {
-            return ErrorMessage;
-        }
-    }
-}

+ 0 - 456
EVCB_OCPP.WEBAPI/Areas/HelpPage/SampleGeneration/ObjectGenerator.cs

@@ -1,456 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
-using System.Globalization;
-using System.Linq;
-using System.Reflection;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage
-{
-    /// <summary>
-    /// This class will create an object of a given type and populate it with sample data.
-    /// </summary>
-    public class ObjectGenerator
-    {
-        internal const int DefaultCollectionSize = 2;
-        private readonly SimpleTypeObjectGenerator SimpleObjectGenerator = new SimpleTypeObjectGenerator();
-
-        /// <summary>
-        /// Generates an object for a given type. The type needs to be public, have a public default constructor and settable public properties/fields. Currently it supports the following types:
-        /// Simple types: <see cref="int"/>, <see cref="string"/>, <see cref="Enum"/>, <see cref="DateTime"/>, <see cref="Uri"/>, etc.
-        /// Complex types: POCO types.
-        /// Nullables: <see cref="Nullable{T}"/>.
-        /// Arrays: arrays of simple types or complex types.
-        /// Key value pairs: <see cref="KeyValuePair{TKey,TValue}"/>
-        /// Tuples: <see cref="Tuple{T1}"/>, <see cref="Tuple{T1,T2}"/>, etc
-        /// Dictionaries: <see cref="IDictionary{TKey,TValue}"/> or anything deriving from <see cref="IDictionary{TKey,TValue}"/>.
-        /// Collections: <see cref="IList{T}"/>, <see cref="IEnumerable{T}"/>, <see cref="ICollection{T}"/>, <see cref="IList"/>, <see cref="IEnumerable"/>, <see cref="ICollection"/> or anything deriving from <see cref="ICollection{T}"/> or <see cref="IList"/>.
-        /// Queryables: <see cref="IQueryable"/>, <see cref="IQueryable{T}"/>.
-        /// </summary>
-        /// <param name="type">The type.</param>
-        /// <returns>An object of the given type.</returns>
-        public object GenerateObject(Type type)
-        {
-            return GenerateObject(type, new Dictionary<Type, object>());
-        }
-
-        [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Here we just want to return null if anything goes wrong.")]
-        private object GenerateObject(Type type, Dictionary<Type, object> createdObjectReferences)
-        {
-            try
-            {
-                if (SimpleTypeObjectGenerator.CanGenerateObject(type))
-                {
-                    return SimpleObjectGenerator.GenerateObject(type);
-                }
-
-                if (type.IsArray)
-                {
-                    return GenerateArray(type, DefaultCollectionSize, createdObjectReferences);
-                }
-
-                if (type.IsGenericType)
-                {
-                    return GenerateGenericType(type, DefaultCollectionSize, createdObjectReferences);
-                }
-
-                if (type == typeof(IDictionary))
-                {
-                    return GenerateDictionary(typeof(Hashtable), DefaultCollectionSize, createdObjectReferences);
-                }
-
-                if (typeof(IDictionary).IsAssignableFrom(type))
-                {
-                    return GenerateDictionary(type, DefaultCollectionSize, createdObjectReferences);
-                }
-
-                if (type == typeof(IList) ||
-                    type == typeof(IEnumerable) ||
-                    type == typeof(ICollection))
-                {
-                    return GenerateCollection(typeof(ArrayList), DefaultCollectionSize, createdObjectReferences);
-                }
-
-                if (typeof(IList).IsAssignableFrom(type))
-                {
-                    return GenerateCollection(type, DefaultCollectionSize, createdObjectReferences);
-                }
-
-                if (type == typeof(IQueryable))
-                {
-                    return GenerateQueryable(type, DefaultCollectionSize, createdObjectReferences);
-                }
-
-                if (type.IsEnum)
-                {
-                    return GenerateEnum(type);
-                }
-
-                if (type.IsPublic || type.IsNestedPublic)
-                {
-                    return GenerateComplexObject(type, createdObjectReferences);
-                }
-            }
-            catch
-            {
-                // Returns null if anything fails
-                return null;
-            }
-
-            return null;
-        }
-
-        private static object GenerateGenericType(Type type, int collectionSize, Dictionary<Type, object> createdObjectReferences)
-        {
-            Type genericTypeDefinition = type.GetGenericTypeDefinition();
-            if (genericTypeDefinition == typeof(Nullable<>))
-            {
-                return GenerateNullable(type, createdObjectReferences);
-            }
-
-            if (genericTypeDefinition == typeof(KeyValuePair<,>))
-            {
-                return GenerateKeyValuePair(type, createdObjectReferences);
-            }
-
-            if (IsTuple(genericTypeDefinition))
-            {
-                return GenerateTuple(type, createdObjectReferences);
-            }
-
-            Type[] genericArguments = type.GetGenericArguments();
-            if (genericArguments.Length == 1)
-            {
-                if (genericTypeDefinition == typeof(IList<>) ||
-                    genericTypeDefinition == typeof(IEnumerable<>) ||
-                    genericTypeDefinition == typeof(ICollection<>))
-                {
-                    Type collectionType = typeof(List<>).MakeGenericType(genericArguments);
-                    return GenerateCollection(collectionType, collectionSize, createdObjectReferences);
-                }
-
-                if (genericTypeDefinition == typeof(IQueryable<>))
-                {
-                    return GenerateQueryable(type, collectionSize, createdObjectReferences);
-                }
-
-                Type closedCollectionType = typeof(ICollection<>).MakeGenericType(genericArguments[0]);
-                if (closedCollectionType.IsAssignableFrom(type))
-                {
-                    return GenerateCollection(type, collectionSize, createdObjectReferences);
-                }
-            }
-
-            if (genericArguments.Length == 2)
-            {
-                if (genericTypeDefinition == typeof(IDictionary<,>))
-                {
-                    Type dictionaryType = typeof(Dictionary<,>).MakeGenericType(genericArguments);
-                    return GenerateDictionary(dictionaryType, collectionSize, createdObjectReferences);
-                }
-
-                Type closedDictionaryType = typeof(IDictionary<,>).MakeGenericType(genericArguments[0], genericArguments[1]);
-                if (closedDictionaryType.IsAssignableFrom(type))
-                {
-                    return GenerateDictionary(type, collectionSize, createdObjectReferences);
-                }
-            }
-
-            if (type.IsPublic || type.IsNestedPublic)
-            {
-                return GenerateComplexObject(type, createdObjectReferences);
-            }
-
-            return null;
-        }
-
-        private static object GenerateTuple(Type type, Dictionary<Type, object> createdObjectReferences)
-        {
-            Type[] genericArgs = type.GetGenericArguments();
-            object[] parameterValues = new object[genericArgs.Length];
-            bool failedToCreateTuple = true;
-            ObjectGenerator objectGenerator = new ObjectGenerator();
-            for (int i = 0; i < genericArgs.Length; i++)
-            {
-                parameterValues[i] = objectGenerator.GenerateObject(genericArgs[i], createdObjectReferences);
-                failedToCreateTuple &= parameterValues[i] == null;
-            }
-            if (failedToCreateTuple)
-            {
-                return null;
-            }
-            object result = Activator.CreateInstance(type, parameterValues);
-            return result;
-        }
-
-        private static bool IsTuple(Type genericTypeDefinition)
-        {
-            return genericTypeDefinition == typeof(Tuple<>) ||
-                genericTypeDefinition == typeof(Tuple<,>) ||
-                genericTypeDefinition == typeof(Tuple<,,>) ||
-                genericTypeDefinition == typeof(Tuple<,,,>) ||
-                genericTypeDefinition == typeof(Tuple<,,,,>) ||
-                genericTypeDefinition == typeof(Tuple<,,,,,>) ||
-                genericTypeDefinition == typeof(Tuple<,,,,,,>) ||
-                genericTypeDefinition == typeof(Tuple<,,,,,,,>);
-        }
-
-        private static object GenerateKeyValuePair(Type keyValuePairType, Dictionary<Type, object> createdObjectReferences)
-        {
-            Type[] genericArgs = keyValuePairType.GetGenericArguments();
-            Type typeK = genericArgs[0];
-            Type typeV = genericArgs[1];
-            ObjectGenerator objectGenerator = new ObjectGenerator();
-            object keyObject = objectGenerator.GenerateObject(typeK, createdObjectReferences);
-            object valueObject = objectGenerator.GenerateObject(typeV, createdObjectReferences);
-            if (keyObject == null && valueObject == null)
-            {
-                // Failed to create key and values
-                return null;
-            }
-            object result = Activator.CreateInstance(keyValuePairType, keyObject, valueObject);
-            return result;
-        }
-
-        private static object GenerateArray(Type arrayType, int size, Dictionary<Type, object> createdObjectReferences)
-        {
-            Type type = arrayType.GetElementType();
-            Array result = Array.CreateInstance(type, size);
-            bool areAllElementsNull = true;
-            ObjectGenerator objectGenerator = new ObjectGenerator();
-            for (int i = 0; i < size; i++)
-            {
-                object element = objectGenerator.GenerateObject(type, createdObjectReferences);
-                result.SetValue(element, i);
-                areAllElementsNull &= element == null;
-            }
-
-            if (areAllElementsNull)
-            {
-                return null;
-            }
-
-            return result;
-        }
-
-        private static object GenerateDictionary(Type dictionaryType, int size, Dictionary<Type, object> createdObjectReferences)
-        {
-            Type typeK = typeof(object);
-            Type typeV = typeof(object);
-            if (dictionaryType.IsGenericType)
-            {
-                Type[] genericArgs = dictionaryType.GetGenericArguments();
-                typeK = genericArgs[0];
-                typeV = genericArgs[1];
-            }
-
-            object result = Activator.CreateInstance(dictionaryType);
-            MethodInfo addMethod = dictionaryType.GetMethod("Add") ?? dictionaryType.GetMethod("TryAdd");
-            MethodInfo containsMethod = dictionaryType.GetMethod("Contains") ?? dictionaryType.GetMethod("ContainsKey");
-            ObjectGenerator objectGenerator = new ObjectGenerator();
-            for (int i = 0; i < size; i++)
-            {
-                object newKey = objectGenerator.GenerateObject(typeK, createdObjectReferences);
-                if (newKey == null)
-                {
-                    // Cannot generate a valid key
-                    return null;
-                }
-
-                bool containsKey = (bool)containsMethod.Invoke(result, new object[] { newKey });
-                if (!containsKey)
-                {
-                    object newValue = objectGenerator.GenerateObject(typeV, createdObjectReferences);
-                    addMethod.Invoke(result, new object[] { newKey, newValue });
-                }
-            }
-
-            return result;
-        }
-
-        private static object GenerateEnum(Type enumType)
-        {
-            Array possibleValues = Enum.GetValues(enumType);
-            if (possibleValues.Length > 0)
-            {
-                return possibleValues.GetValue(0);
-            }
-            return null;
-        }
-
-        private static object GenerateQueryable(Type queryableType, int size, Dictionary<Type, object> createdObjectReferences)
-        {
-            bool isGeneric = queryableType.IsGenericType;
-            object list;
-            if (isGeneric)
-            {
-                Type listType = typeof(List<>).MakeGenericType(queryableType.GetGenericArguments());
-                list = GenerateCollection(listType, size, createdObjectReferences);
-            }
-            else
-            {
-                list = GenerateArray(typeof(object[]), size, createdObjectReferences);
-            }
-            if (list == null)
-            {
-                return null;
-            }
-            if (isGeneric)
-            {
-                Type argumentType = typeof(IEnumerable<>).MakeGenericType(queryableType.GetGenericArguments());
-                MethodInfo asQueryableMethod = typeof(Queryable).GetMethod("AsQueryable", new[] { argumentType });
-                return asQueryableMethod.Invoke(null, new[] { list });
-            }
-
-            return Queryable.AsQueryable((IEnumerable)list);
-        }
-
-        private static object GenerateCollection(Type collectionType, int size, Dictionary<Type, object> createdObjectReferences)
-        {
-            Type type = collectionType.IsGenericType ?
-                collectionType.GetGenericArguments()[0] :
-                typeof(object);
-            object result = Activator.CreateInstance(collectionType);
-            MethodInfo addMethod = collectionType.GetMethod("Add");
-            bool areAllElementsNull = true;
-            ObjectGenerator objectGenerator = new ObjectGenerator();
-            for (int i = 0; i < size; i++)
-            {
-                object element = objectGenerator.GenerateObject(type, createdObjectReferences);
-                addMethod.Invoke(result, new object[] { element });
-                areAllElementsNull &= element == null;
-            }
-
-            if (areAllElementsNull)
-            {
-                return null;
-            }
-
-            return result;
-        }
-
-        private static object GenerateNullable(Type nullableType, Dictionary<Type, object> createdObjectReferences)
-        {
-            Type type = nullableType.GetGenericArguments()[0];
-            ObjectGenerator objectGenerator = new ObjectGenerator();
-            return objectGenerator.GenerateObject(type, createdObjectReferences);
-        }
-
-        private static object GenerateComplexObject(Type type, Dictionary<Type, object> createdObjectReferences)
-        {
-            object result = null;
-
-            if (createdObjectReferences.TryGetValue(type, out result))
-            {
-                // The object has been created already, just return it. This will handle the circular reference case.
-                return result;
-            }
-
-            if (type.IsValueType)
-            {
-                result = Activator.CreateInstance(type);
-            }
-            else
-            {
-                ConstructorInfo defaultCtor = type.GetConstructor(Type.EmptyTypes);
-                if (defaultCtor == null)
-                {
-                    // Cannot instantiate the type because it doesn't have a default constructor
-                    return null;
-                }
-
-                result = defaultCtor.Invoke(new object[0]);
-            }
-            createdObjectReferences.Add(type, result);
-            SetPublicProperties(type, result, createdObjectReferences);
-            SetPublicFields(type, result, createdObjectReferences);
-            return result;
-        }
-
-        private static void SetPublicProperties(Type type, object obj, Dictionary<Type, object> createdObjectReferences)
-        {
-            PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
-            ObjectGenerator objectGenerator = new ObjectGenerator();
-            foreach (PropertyInfo property in properties)
-            {
-                if (property.CanWrite)
-                {
-                    object propertyValue = objectGenerator.GenerateObject(property.PropertyType, createdObjectReferences);
-                    property.SetValue(obj, propertyValue, null);
-                }
-            }
-        }
-
-        private static void SetPublicFields(Type type, object obj, Dictionary<Type, object> createdObjectReferences)
-        {
-            FieldInfo[] fields = type.GetFields(BindingFlags.Public | BindingFlags.Instance);
-            ObjectGenerator objectGenerator = new ObjectGenerator();
-            foreach (FieldInfo field in fields)
-            {
-                object fieldValue = objectGenerator.GenerateObject(field.FieldType, createdObjectReferences);
-                field.SetValue(obj, fieldValue);
-            }
-        }
-
-        private class SimpleTypeObjectGenerator
-        {
-            private long _index = 0;
-            private static readonly Dictionary<Type, Func<long, object>> DefaultGenerators = InitializeGenerators();
-
-            [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "These are simple type factories and cannot be split up.")]
-            private static Dictionary<Type, Func<long, object>> InitializeGenerators()
-            {
-                return new Dictionary<Type, Func<long, object>>
-                {
-                    { typeof(Boolean), index => true },
-                    { typeof(Byte), index => (Byte)64 },
-                    { typeof(Char), index => (Char)65 },
-                    { typeof(DateTime), index => DateTime.Now },
-                    { typeof(DateTimeOffset), index => new DateTimeOffset(DateTime.Now) },
-                    { typeof(DBNull), index => DBNull.Value },
-                    { typeof(Decimal), index => (Decimal)index },
-                    { typeof(Double), index => (Double)(index + 0.1) },
-                    { typeof(Guid), index => Guid.NewGuid() },
-                    { typeof(Int16), index => (Int16)(index % Int16.MaxValue) },
-                    { typeof(Int32), index => (Int32)(index % Int32.MaxValue) },
-                    { typeof(Int64), index => (Int64)index },
-                    { typeof(Object), index => new object() },
-                    { typeof(SByte), index => (SByte)64 },
-                    { typeof(Single), index => (Single)(index + 0.1) },
-                    { 
-                        typeof(String), index =>
-                        {
-                            return String.Format(CultureInfo.CurrentCulture, "sample string {0}", index);
-                        }
-                    },
-                    { 
-                        typeof(TimeSpan), index =>
-                        {
-                            return TimeSpan.FromTicks(1234567);
-                        }
-                    },
-                    { typeof(UInt16), index => (UInt16)(index % UInt16.MaxValue) },
-                    { typeof(UInt32), index => (UInt32)(index % UInt32.MaxValue) },
-                    { typeof(UInt64), index => (UInt64)index },
-                    { 
-                        typeof(Uri), index =>
-                        {
-                            return new Uri(String.Format(CultureInfo.CurrentCulture, "http://webapihelppage{0}.com", index));
-                        }
-                    },
-                };
-            }
-
-            public static bool CanGenerateObject(Type type)
-            {
-                return DefaultGenerators.ContainsKey(type);
-            }
-
-            public object GenerateObject(Type type)
-            {
-                return DefaultGenerators[type](++_index);
-            }
-        }
-    }
-}

+ 0 - 11
EVCB_OCPP.WEBAPI/Areas/HelpPage/SampleGeneration/SampleDirection.cs

@@ -1,11 +0,0 @@
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage
-{
-    /// <summary>
-    /// Indicates whether the sample is used for request or response
-    /// </summary>
-    public enum SampleDirection
-    {
-        Request = 0,
-        Response
-    }
-}

+ 0 - 37
EVCB_OCPP.WEBAPI/Areas/HelpPage/SampleGeneration/TextSample.cs

@@ -1,37 +0,0 @@
-using System;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage
-{
-    /// <summary>
-    /// This represents a preformatted text sample on the help page. There's a display template named TextSample associated with this class.
-    /// </summary>
-    public class TextSample
-    {
-        public TextSample(string text)
-        {
-            if (text == null)
-            {
-                throw new ArgumentNullException("text");
-            }
-            Text = text;
-        }
-
-        public string Text { get; private set; }
-
-        public override bool Equals(object obj)
-        {
-            TextSample other = obj as TextSample;
-            return other != null && Text == other.Text;
-        }
-
-        public override int GetHashCode()
-        {
-            return Text.GetHashCode();
-        }
-
-        public override string ToString()
-        {
-            return Text;
-        }
-    }
-}

+ 0 - 21
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/Api.cshtml

@@ -1,21 +0,0 @@
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage.Models
-@model HelpPageApiModel
-
-@{
-    var description = Model.ApiDescription;
-    ViewBag.Title = description.HttpMethod.Method + " " + description.RelativePath;
-}
-
-<link type="text/css" href="~/Areas/HelpPage/HelpPage.css" rel="stylesheet" />
-<div id="body" class="help-page">
-    <section class="featured">
-        <div class="content-wrapper">
-            <p>
-                @Html.ActionLink("Help Page Home", "Index")
-            </p>
-        </div>
-    </section>
-    <section class="content-wrapper main-content clear-fix">
-        @Html.DisplayForModel()
-    </section>
-</div>

+ 0 - 38
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ApiGroup.cshtml

@@ -1,38 +0,0 @@
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage.Models
-@model IGrouping<HttpControllerDescriptor, ApiDescription>
-
-@{
-    var controllerDocumentation = ViewBag.DocumentationProvider != null ? 
-        ViewBag.DocumentationProvider.GetDocumentation(Model.Key) : 
-        null;
-}
-
-<h2 id="@Model.Key.ControllerName">@Model.Key.ControllerName</h2>
-@if (!String.IsNullOrEmpty(controllerDocumentation))
-{
-    <p>@controllerDocumentation</p>
-}
-<table class="help-page-table">
-    <thead>
-        <tr><th>API</th><th>Description</th></tr>
-    </thead>
-    <tbody>
-    @foreach (var api in Model)
-    {
-        <tr>
-            <td class="api-name"><a href="@Url.Action("Api", "Help", new { apiId = api.GetFriendlyId() })">@api.HttpMethod.Method @api.RelativePath</a></td>
-            <td class="api-documentation">
-            @if (api.Documentation != null)
-            {
-                <p>@api.Documentation</p>
-            }
-            else
-            {
-                <p>No documentation available.</p>
-            }
-            </td>
-        </tr>
-    }
-    </tbody>
-</table>

+ 0 - 6
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/CollectionModelDescription.cshtml

@@ -1,6 +0,0 @@
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-@model CollectionModelDescription
-@if (Model.ElementDescription is ComplexTypeModelDescription)
-{
-    @Html.DisplayFor(m => m.ElementDescription)
-}

+ 0 - 3
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ComplexTypeModelDescription.cshtml

@@ -1,3 +0,0 @@
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-@model ComplexTypeModelDescription
-@Html.DisplayFor(m => m.Properties, "Parameters")

+ 0 - 4
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/DictionaryModelDescription.cshtml

@@ -1,4 +0,0 @@
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-@model DictionaryModelDescription
-Dictionary of @Html.DisplayFor(m => Model.KeyModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.KeyModelDescription }) [key]
-and @Html.DisplayFor(m => Model.ValueModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ValueModelDescription }) [value]

+ 0 - 24
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/EnumTypeModelDescription.cshtml

@@ -1,24 +0,0 @@
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-@model EnumTypeModelDescription
-
-<p>Possible enumeration values:</p>
-
-<table class="help-page-table">
-    <thead>
-        <tr><th>Name</th><th>Value</th><th>Description</th></tr>
-    </thead>
-    <tbody>
-        @foreach (EnumValueDescription value in Model.Values)
-        {
-            <tr>
-                <td class="enum-name"><b>@value.Name</b></td>
-                <td class="enum-value">
-                    <p>@value.Value</p>
-                </td>
-                <td class="enum-description">
-                    <p>@value.Documentation</p>
-                </td>
-            </tr>
-        }
-    </tbody>
-</table>

+ 0 - 65
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/HelpPageApiModel.cshtml

@@ -1,65 +0,0 @@
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage.Models
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-@model HelpPageApiModel
-
-@{
-    ApiDescription description = Model.ApiDescription;
-}
-<h1>@description.HttpMethod.Method @description.RelativePath</h1>
-<div>
-    <p>@description.Documentation</p>
-
-    <h2>Request Information</h2>
-
-    <h3>URI Parameters</h3>
-    @Html.DisplayFor(m => m.UriParameters, "Parameters")
-
-    <h3>Body Parameters</h3>
-
-    <p>@Model.RequestDocumentation</p>
-
-    @if (Model.RequestModelDescription != null)
-    {
-        @Html.DisplayFor(m => m.RequestModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.RequestModelDescription })
-        if (Model.RequestBodyParameters != null)
-        {
-            @Html.DisplayFor(m => m.RequestBodyParameters, "Parameters")
-        }
-    }
-    else
-    {
-        <p>None.</p>
-    }
-
-    @if (Model.SampleRequests.Count > 0)
-    {
-        <h3>Request Formats</h3>
-        @Html.DisplayFor(m => m.SampleRequests, "Samples")
-    }
-
-    <h2>Response Information</h2>
-
-    <h3>Resource Description</h3>
-
-    <p>@description.ResponseDescription.Documentation</p>
-
-    @if (Model.ResourceDescription != null)
-    {
-        @Html.DisplayFor(m => m.ResourceDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ResourceDescription })
-        if (Model.ResourceProperties != null)
-        {
-            @Html.DisplayFor(m => m.ResourceProperties, "Parameters")
-        }
-    }
-    else
-    {
-        <p>None.</p>
-    }
-
-    @if (Model.SampleResponses.Count > 0)
-    {
-        <h3>Response Formats</h3>
-        @Html.DisplayFor(m => m.SampleResponses, "Samples")
-    }
-
-</div>

+ 0 - 4
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ImageSample.cshtml

@@ -1,4 +0,0 @@
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage
-@model ImageSample
-
-<img src="@Model.Src" />

+ 0 - 14
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/InvalidSample.cshtml

@@ -1,14 +0,0 @@
-@using EVCB_OCPP.WEBAPI
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage
-@model InvalidSample
-
-@if (System.Diagnostics.Debugger.IsAttached)
-{
-    <div class="warning-message-container">
-        <p>@Model.ErrorMessage</p>
-    </div>
-}
-else
-{
-    <p>Sample not available.</p>
-}

+ 0 - 4
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/KeyValuePairModelDescription.cshtml

@@ -1,4 +0,0 @@
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-@model KeyValuePairModelDescription
-Pair of @Html.DisplayFor(m => Model.KeyModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.KeyModelDescription }) [key]
-and @Html.DisplayFor(m => Model.ValueModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ValueModelDescription }) [value]

+ 0 - 26
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/ModelDescriptionLink.cshtml

@@ -1,26 +0,0 @@
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-@model Type
-@{
-    ModelDescription modelDescription = ViewBag.modelDescription;
-    if (modelDescription is ComplexTypeModelDescription || modelDescription is EnumTypeModelDescription)
-    {
-        if (Model == typeof(Object))
-        {
-            @:Object
-        }
-        else
-        {
-            @Html.ActionLink(modelDescription.Name, "ResourceModel", "Help", new { modelName = modelDescription.Name }, null)
-        }
-    }
-    else if (modelDescription is CollectionModelDescription)
-    {
-        var collectionDescription = modelDescription as CollectionModelDescription;
-        var elementDescription = collectionDescription.ElementDescription;
-        @:Collection of @Html.DisplayFor(m => elementDescription.ModelType, "ModelDescriptionLink", new { modelDescription = elementDescription })
-    }
-    else
-    {
-        @Html.DisplayFor(m => modelDescription)
-    }
-}

+ 0 - 47
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/Parameters.cshtml

@@ -1,47 +0,0 @@
-@using System.Collections.Generic
-@using System.Collections.ObjectModel
-@using System.Threading
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-@model IList<ParameterDescription>
-
-@if (Model.Count > 0)
-{
-    <table class="help-page-table">
-        <thead>
-            <tr><th>Name</th><th>Description</th><th>Type</th><th>Additional information</th></tr>
-        </thead>
-        <tbody>
-            @foreach (ParameterDescription parameter in Model)
-            {
-                ModelDescription modelDescription = parameter.TypeDescription;
-                <tr>
-                    <td class="parameter-name">@parameter.Name</td>
-                    <td class="parameter-documentation">
-                        <p>@parameter.Documentation</p>
-                    </td>
-                    <td class="parameter-type">
-                        @Html.DisplayFor(m => modelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = modelDescription })
-                    </td>
-                    <td class="parameter-annotations">
-                        @if (parameter.Annotations.Count > 0)
-                        {
-                            foreach (var annotation in parameter.Annotations)
-                            {
-                                <p>@annotation.Documentation</p>
-                            }
-                        }
-                        else
-                        {
-                            <p>None.</p>
-                        }
-                    </td>
-                </tr>
-            }
-        </tbody>
-    </table>
-}
-else
-{
-    <p>None.</p>
-}
-

+ 0 - 30
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/Samples.cshtml

@@ -1,30 +0,0 @@
-@using System.Net.Http.Headers
-@model Dictionary<MediaTypeHeaderValue, object>
-
-@{
-    // Group the samples into a single tab if they are the same.
-    Dictionary<string, object> samples = Model.GroupBy(pair => pair.Value).ToDictionary(
-        pair => String.Join(", ", pair.Select(m => m.Key.ToString()).ToArray()), 
-        pair => pair.Key);
-    var mediaTypes = samples.Keys;
-}
-<div>
-    @foreach (var mediaType in mediaTypes)
-    {
-        <h4 class="sample-header">@mediaType</h4>
-        <div class="sample-content">
-            <span><b>Sample:</b></span>
-            @{
-                var sample = samples[mediaType];
-                if (sample == null)
-                {
-                    <p>Sample not available.</p>
-                }
-                else
-                {
-                    @Html.DisplayFor(s => sample);
-                }
-            }
-        </div>
-    }
-</div>

+ 0 - 3
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/SimpleTypeModelDescription.cshtml

@@ -1,3 +0,0 @@
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-@model SimpleTypeModelDescription
-@Model.Documentation

+ 0 - 6
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/DisplayTemplates/TextSample.cshtml

@@ -1,6 +0,0 @@
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage
-@model TextSample
-
-<pre class="wrapped">
-@Model.Text
-</pre>

+ 0 - 35
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/Index.cshtml

@@ -1,35 +0,0 @@
-@using System.Collections.ObjectModel
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage.Models
-@model Collection<ApiDescription>
-
-@{
-    ViewBag.Title = "ASP.NET Web API Help Page";
-
-    // Group APIs by controller
-    ILookup<HttpControllerDescriptor, ApiDescription> apiGroups = Model.ToLookup(api => api.ActionDescriptor.ControllerDescriptor);
-}
-
-<link type="text/css" href="~/Areas/HelpPage/HelpPage.css" rel="stylesheet" />
-<header class="help-page">
-    <div class="content-wrapper">
-        <div class="float-left">
-            <h1>@ViewBag.Title</h1>
-        </div>
-    </div>
-</header>
-<div id="body" class="help-page">
-    <section class="featured">
-        <div class="content-wrapper">
-            <h2>Introduction</h2>
-            <p>
-                Provide a general description of your APIs here.
-            </p>
-        </div>
-    </section>
-    <section class="content-wrapper main-content clear-fix">
-        @foreach (var group in apiGroups)
-        {
-            @Html.DisplayFor(m => group, "ApiGroup")
-        }
-    </section>
-</div>

+ 0 - 18
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Help/ResourceModel.cshtml

@@ -1,18 +0,0 @@
-@using EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions
-@model ModelDescription
-
-<link type="text/css" href="~/Areas/HelpPage/HelpPage.css" rel="stylesheet" />
-<div id="body" class="help-page">
-    <section class="featured">
-        <div class="content-wrapper">
-            <p>
-                @Html.ActionLink("Help Page Home", "Index")
-            </p>
-        </div>
-    </section>
-    <h1>@Model.Name</h1>
-    <p>@Model.Documentation</p>
-    <section class="content-wrapper main-content clear-fix">
-        @Html.DisplayFor(m => Model)
-    </section>
-</div>

+ 0 - 12
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Shared/_Layout.cshtml

@@ -1,12 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="utf-8" />
-    <meta name="viewport" content="width=device-width" />
-    <title>@ViewBag.Title</title>
-    @RenderSection("scripts", required: false)
-</head>
-<body>
-    @RenderBody()
-</body>
-</html>

+ 0 - 41
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/Web.config

@@ -1,41 +0,0 @@
-<?xml version="1.0"?>
-
-<configuration>
-  <configSections>
-    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
-      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
-      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
-    </sectionGroup>
-  </configSections>
-
-  <system.web.webPages.razor>
-    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
-    <pages pageBaseType="System.Web.Mvc.WebViewPage">
-      <namespaces>
-        <add namespace="System.Web.Mvc" />
-        <add namespace="System.Web.Mvc.Ajax" />
-        <add namespace="System.Web.Mvc.Html" />
-        <add namespace="System.Web.Routing" />
-      </namespaces>
-    </pages>
-  </system.web.webPages.razor>
-
-  <appSettings>
-    <add key="webpages:Enabled" value="false" />
-  </appSettings>
-
-  <system.web>
-    <compilation debug="true">
-      <assemblies>
-        <add assembly="System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-      </assemblies>
-    </compilation>
-  </system.web>
-
-  <system.webServer>
-    <handlers>
-      <remove name="BlockViewHandler"/>
-      <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
-    </handlers>
-  </system.webServer>
-</configuration>

+ 0 - 4
EVCB_OCPP.WEBAPI/Areas/HelpPage/Views/_ViewStart.cshtml

@@ -1,4 +0,0 @@
-@{
-    // Change the Layout path below to blend the look and feel of the help page with your existing web pages
-    Layout = "~/Views/Shared/_Layout.cshtml";
-}

+ 0 - 159
EVCB_OCPP.WEBAPI/Areas/HelpPage/XmlDocumentationProvider.cs

@@ -1,159 +0,0 @@
-using System;
-using System.Globalization;
-using System.Linq;
-using System.Reflection;
-using System.Xml.XPath;
-using EVCB_OCPP.WEBAPI.Areas.HelpPage.ModelDescriptions;
-
-namespace EVCB_OCPP.WEBAPI.Areas.HelpPage
-{
-    /// <summary>
-    /// A custom <see cref="IDocumentationProvider"/> that reads the API documentation from an XML documentation file.
-    /// </summary>
-    public class XmlDocumentationProvider : IDocumentationProvider, IModelDocumentationProvider
-    {
-        private XPathNavigator _documentNavigator;
-        private const string TypeExpression = "/doc/members/member[@name='T:{0}']";
-        private const string MethodExpression = "/doc/members/member[@name='M:{0}']";
-        private const string PropertyExpression = "/doc/members/member[@name='P:{0}']";
-        private const string FieldExpression = "/doc/members/member[@name='F:{0}']";
-        private const string ParameterExpression = "param[@name='{0}']";
-
-        /// <summary>
-        /// Initializes a new instance of the <see cref="XmlDocumentationProvider"/> class.
-        /// </summary>
-        /// <param name="documentPath">The physical path to XML document.</param>
-        public XmlDocumentationProvider(string documentPath)
-        {
-            if (documentPath == null)
-            {
-                throw new ArgumentNullException("documentPath");
-            }
-            XPathDocument xpath = new XPathDocument(documentPath);
-            _documentNavigator = xpath.CreateNavigator();
-        }
-
-        public string GetDocumentation(HttpControllerDescriptor controllerDescriptor)
-        {
-            XPathNavigator typeNode = GetTypeNode(controllerDescriptor.ControllerType);
-            return GetTagValue(typeNode, "summary");
-        }
-
-        public virtual string GetDocumentation(HttpActionDescriptor actionDescriptor)
-        {
-            XPathNavigator methodNode = GetMethodNode(actionDescriptor);
-            return GetTagValue(methodNode, "summary");
-        }
-
-        public virtual string GetDocumentation(HttpParameterDescriptor parameterDescriptor)
-        {
-            ReflectedHttpParameterDescriptor reflectedParameterDescriptor = parameterDescriptor as ReflectedHttpParameterDescriptor;
-            if (reflectedParameterDescriptor != null)
-            {
-                XPathNavigator methodNode = GetMethodNode(reflectedParameterDescriptor.ActionDescriptor);
-                if (methodNode != null)
-                {
-                    string parameterName = reflectedParameterDescriptor.ParameterInfo.Name;
-                    XPathNavigator parameterNode = methodNode.SelectSingleNode(String.Format(CultureInfo.InvariantCulture, ParameterExpression, parameterName));
-                    if (parameterNode != null)
-                    {
-                        return parameterNode.Value.Trim();
-                    }
-                }
-            }
-
-            return null;
-        }
-
-        public string GetResponseDocumentation(HttpActionDescriptor actionDescriptor)
-        {
-            XPathNavigator methodNode = GetMethodNode(actionDescriptor);
-            return GetTagValue(methodNode, "returns");
-        }
-
-        public string GetDocumentation(MemberInfo member)
-        {
-            string memberName = String.Format(CultureInfo.InvariantCulture, "{0}.{1}", GetTypeName(member.DeclaringType), member.Name);
-            string expression = member.MemberType == MemberTypes.Field ? FieldExpression : PropertyExpression;
-            string selectExpression = String.Format(CultureInfo.InvariantCulture, expression, memberName);
-            XPathNavigator propertyNode = _documentNavigator.SelectSingleNode(selectExpression);
-            return GetTagValue(propertyNode, "summary");
-        }
-
-        public string GetDocumentation(Type type)
-        {
-            XPathNavigator typeNode = GetTypeNode(type);
-            return GetTagValue(typeNode, "summary");
-        }
-
-        private XPathNavigator GetMethodNode(HttpActionDescriptor actionDescriptor)
-        {
-            ReflectedHttpActionDescriptor reflectedActionDescriptor = actionDescriptor as ReflectedHttpActionDescriptor;
-            if (reflectedActionDescriptor != null)
-            {
-                string selectExpression = String.Format(CultureInfo.InvariantCulture, MethodExpression, GetMemberName(reflectedActionDescriptor.MethodInfo));
-                return _documentNavigator.SelectSingleNode(selectExpression);
-            }
-
-            return null;
-        }
-
-        private static string GetMemberName(MethodInfo method)
-        {
-            string name = String.Format(CultureInfo.InvariantCulture, "{0}.{1}", GetTypeName(method.DeclaringType), method.Name);
-            ParameterInfo[] parameters = method.GetParameters();
-            if (parameters.Length != 0)
-            {
-                string[] parameterTypeNames = parameters.Select(param => GetTypeName(param.ParameterType)).ToArray();
-                name += String.Format(CultureInfo.InvariantCulture, "({0})", String.Join(",", parameterTypeNames));
-            }
-
-            return name;
-        }
-
-        private static string GetTagValue(XPathNavigator parentNode, string tagName)
-        {
-            if (parentNode != null)
-            {
-                XPathNavigator node = parentNode.SelectSingleNode(tagName);
-                if (node != null)
-                {
-                    return node.Value.Trim();
-                }
-            }
-
-            return null;
-        }
-
-        private XPathNavigator GetTypeNode(Type type)
-        {
-            string controllerTypeName = GetTypeName(type);
-            string selectExpression = String.Format(CultureInfo.InvariantCulture, TypeExpression, controllerTypeName);
-            return _documentNavigator.SelectSingleNode(selectExpression);
-        }
-
-        private static string GetTypeName(Type type)
-        {
-            string name = type.FullName;
-            if (type.IsGenericType)
-            {
-                // Format the generic type name to something like: Generic{System.Int32,System.String}
-                Type genericType = type.GetGenericTypeDefinition();
-                Type[] genericArguments = type.GetGenericArguments();
-                string genericTypeName = genericType.FullName;
-
-                // Trim the generic parameter counts from the name
-                genericTypeName = genericTypeName.Substring(0, genericTypeName.IndexOf('`'));
-                string[] argumentTypeNames = genericArguments.Select(t => GetTypeName(t)).ToArray();
-                name = String.Format(CultureInfo.InvariantCulture, "{0}{{{1}}}", genericTypeName, String.Join(",", argumentTypeNames));
-            }
-            if (type.IsNested)
-            {
-                // Changing the nested type name from OuterType+InnerType to OuterType.InnerType to match the XML documentation syntax.
-                name = name.Replace("+", ".");
-            }
-
-            return name;
-        }
-    }
-}

+ 21 - 0
EVCB_OCPP.WEBAPI/Controllers/TestController.cs

@@ -0,0 +1,21 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+
+namespace EVCB_OCPP.WEBAPI.Controllers
+{
+    [ApiController]
+    [Route("test")]
+    public class TestController : ControllerBase
+    {
+        public TestController()
+        {
+
+        }
+
+        [HttpGet]
+        public string Get()
+        {
+            return "Hello World";
+        }
+    }
+}

+ 39 - 39
EVCB_OCPP.WEBAPI/Controllers/Version1/CPOController.cs

@@ -19,15 +19,24 @@ using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http.Extensions;
 using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
 
 namespace EVCB_OCPP.WEBAPI.Controllers.Version1
 {
-    [ApiExplorerSettings(IgnoreApi = true)]
+    //[ApiExplorerSettings(IgnoreApi = true)]
+    [ServiceFilter(typeof(CPOAuthentication))]
+    //[CPOAuthentication]
+    [ApiController]
     [Route("api/v1/cpo")]
-    [CPOAuthentication]
     public class CPOController : ControllerBase
     {
         private HttpClientService service = new HttpClientService();
+        private readonly IServiceProvider serviceProvider;
+
+        public CPOController(IServiceProvider serviceProvider)
+        {
+            this.serviceProvider = serviceProvider;
+        }
 
         private bool ContainsChargePoint(string chargeBoxId, out string customerId)
         {
@@ -37,15 +46,12 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
 
             customerId = Request.Headers[EVCBConfiguration.Header_PartnerId].First();
 
-            ChargePointService _service = new ChargePointService();
+            ChargePointService _service = serviceProvider.GetRequiredService<ChargePointService>();//;new ChargePointService();
             return _service.ContainsChargePoint(chargeBoxId, customerId);
 
         }
 
-
-
         [Route("station")]
-        [Produces(typeof(CPOOuterResponse))]
         [HttpGet]
         public IActionResult Station()
         {
@@ -57,7 +63,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
                 if (Request.Headers.Keys.Contains(EVCBConfiguration.Header_PartnerId))
                 {
                     var _customerId = Request.Headers[EVCBConfiguration.Header_PartnerId].First();
-                    ChargingStationService _service = new ChargingStationService();
+                    ChargingStationService _service = serviceProvider.GetRequiredService<ChargingStationService>();
                     var _innerResponse = new { Stations = _service.GetStationsbyCustomerId(_customerId) };
                     result.Data = JsonConvert.SerializeObject(_innerResponse, EVCBConfiguration.JSONSERIALIZER_FORMAT);
                     result.StatusCode = (int)CPO_StatusCode.Success;
@@ -89,14 +95,14 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePointService _CPService = new ChargePointService();
+                ChargePointService _CPService = serviceProvider.GetRequiredService<ChargePointService>();// new ChargePointService();
                 var tt = _CPService.GetLastUpdatedTimebyMachineId("0da4f4a6-a952-46f0-b2f3-696385a9a56a");
                 if (Request.Headers.Keys.Contains(EVCBConfiguration.Header_PartnerId))
                 {
                     var _customerId = Request.Headers[EVCBConfiguration.Header_PartnerId].First();
 
                     var _innerResponse = new { EVSEs = new List<EVSE>() };
-                    ChargingStationService _stationService = new ChargingStationService();
+                    ChargingStationService _stationService = serviceProvider.GetRequiredService<ChargingStationService>();// new ChargingStationService();
 
                     if (StationId > -1)
                     {
@@ -178,7 +184,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
                     return StatusCode(statusCode, result);
                 }
 
-                ChargePointService _CPService = new ChargePointService();
+                ChargePointService _CPService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!string.IsNullOrEmpty(request.ChargeBoxId) && request.ChargeBoxId.Length <= 25 && (!request.ConnectorId.HasValue
                    || (_CPService.GetNumberofConnectors(request.ChargeBoxId) >= request.ConnectorId && request.ConnectorId > 0))
@@ -186,7 +192,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
                 {
 
                     InternalHttpClient _client = new InternalHttpClient();
-                    CustomerService _customer = new CustomerService();
+                    ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
                     //trigger to charge
                     var _request = new Models.WebAPI.StartTransactionRequest()
@@ -287,7 +293,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
                 string[] parts = Request.GetDisplayUrl().Split('/');
 
@@ -373,7 +379,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
                 string[] parts = Request.GetDisplayUrl().Split('/');
                 string urlformat = "{0}//{1}/api/v1/ocpp16/reservation?ChargeBoxId={2}";
@@ -464,7 +470,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
                 string[] parts = Request.GetDisplayUrl().Split('/');
@@ -548,7 +554,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
                 string[] parts = Request.GetDisplayUrl().Split('/');
@@ -633,7 +639,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
                 string[] parts = Request.GetDisplayUrl().Split('/');
@@ -676,7 +682,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
                         statusCode = StatusCodes.Status400BadRequest;
                     }
                 }
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -732,7 +738,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
                 string[] parts = Request.GetDisplayUrl().Split('/');
@@ -816,7 +822,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
 
@@ -906,7 +912,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
 
@@ -996,7 +1002,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
                 int? orderNo = (int?)null;
 
@@ -1173,7 +1179,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
 
             try
             {
-                ChargePointService _service = new ChargePointService();
+                ChargePointService _service = serviceProvider.GetRequiredService<ChargePointService>();
                 string version = _service.GetVersionbyChargeBoxId(ChargeBoxId);
 
                 result.Data = version;
@@ -1222,7 +1228,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
                 }
 
                 // query meter value
-                ChargePointService _service = new ChargePointService();
+                ChargePointService _service = serviceProvider.GetRequiredService<ChargePointService>();
                 var transactionDatas = _service.GetActiveSessionInfo(ChargeBoxId, new List<Measurand>()
                 {  Measurand.Voltage,
                    Measurand.Current_Import,
@@ -1326,7 +1332,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
                 DateTime startDt = string.IsNullOrEmpty(StartTime) ? new DateTime(1991, 1, 1) : DateTime.Parse(StartTime);
                 DateTime stopDt = string.IsNullOrEmpty(StopTime) ? new DateTime(1991, 1, 1) : DateTime.Parse(StopTime);
                 // query meter value
-                ChargePointService _service = new ChargePointService();
+                ChargePointService _service = serviceProvider.GetRequiredService<ChargePointService>();
                 var _innerData = _service.GetSessionDetail(ChargeBoxId, SessionId, IdTag, startDt, stopDt);
 
                 if (_innerData == null)
@@ -1373,10 +1379,9 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             {
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
-                //string url = System.Web.Configuration.WebConfigurationManager.AppSettings["StatisticsAPI"] + 1;
-                string url = configuration["configuration"] + 1;
+                string url = configuration["StatisticsAPI"] + 1;
                 string chargeBoxIds = GetStatisticChargeBoxIds(request.ChargeBoxIds);
 
                 HttpClientService service = new HttpClientService();
@@ -1436,10 +1441,9 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             {
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
-                //string url = System.Web.Configuration.WebConfigurationManager.AppSettings["StatisticsAPI"] + 2;
-                string url = configuration["configuration"] + 2;
+                string url = configuration["StatisticsAPI"] + 2;
                 string chargeBoxIds = GetStatisticChargeBoxIds(request.ChargeBoxIds);
 
                 HttpClientService service = new HttpClientService();
@@ -1499,10 +1503,9 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             {
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
-                //string url = System.Web.Configuration.WebConfigurationManager.AppSettings["StatisticsAPI"] + 3;
-                string url = configuration["configuration"] + 3;
+                string url = configuration["StatisticsAPI"] + 3;
                 string chargeBoxIds = GetStatisticChargeBoxIds(request.ChargeBoxIds);
 
                 HttpClientService service = new HttpClientService();
@@ -1562,9 +1565,8 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             {
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
-                //string url = System.Web.Configuration.WebConfigurationManager.AppSettings["StatisticsAPI"] + 4;
                 string url = configuration["StatisticsAPI"] + 4;
                 string chargeBoxIds = GetStatisticChargeBoxIds(request.ChargeBoxIds);
 
@@ -1624,9 +1626,8 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             {
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
-                //string url = System.Web.Configuration.WebConfigurationManager.AppSettings["StatisticsAPI"] + 6;
                 string url = configuration["StatisticsAPI"] + 6;
                 string chargeBoxIds = GetStatisticChargeBoxIds(request.ChargeBoxIds);
 
@@ -1688,9 +1689,8 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             {
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
-                //string url = System.Web.Configuration.WebConfigurationManager.AppSettings["StatisticsAPI"] + 5;
                 string url = configuration["StatisticsAPI"] + 5;
                 string chargeBoxIds = GetStatisticChargeBoxIds(request.ChargeBoxIds);
 

+ 31 - 23
EVCB_OCPP.WEBAPI/Controllers/Version1/InternalController.cs

@@ -11,6 +11,7 @@ using EVCB_OCPP.WEBAPI.Models.WebAPI;
 using EVCB_OCPP.WEBAPI.Services;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.DependencyInjection;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using System;
@@ -25,9 +26,16 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
 {
     [ApiExplorerSettings(IgnoreApi = true)]
     [Route("api/v1/ocpp16")]
-    [InernalAuthentication]
+    //[InernalAuthentication]
+    [ServiceFilter(typeof(InernalAuthentication))]
     public class InternalV1Controller : ControllerBase
     {
+        private readonly IServiceProvider serviceProvider;
+
+        public InternalV1Controller(IServiceProvider serviceProvider)
+        {
+            this.serviceProvider = serviceProvider;
+        }
 
         [Route("command")]
         //[Produces(typeof(ErrorResponse))]
@@ -42,7 +50,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             try
             {
 
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();//serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!IsValidEnum<Internal_Actions>(OrderNo) || string.IsNullOrEmpty(ChargeBoxId))
                 {
@@ -66,7 +74,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
                         });
                 }
 
-                ServerTriggerService triggerService = new ServerTriggerService();
+                ServerTriggerService triggerService = serviceProvider.GetRequiredService<ServerTriggerService>();//new ServerTriggerService();
                 var excution = triggerService.GetExecution(SerialNo, (Internal_Actions)OrderNo, ChargeBoxId);
 
                 if (excution == null)
@@ -122,7 +130,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             try
             {
 
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -207,7 +215,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             try
             {
                 //Does charge exist ? 
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
@@ -283,7 +291,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             {
 
                 //Does charge exist ? 
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -360,7 +368,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             try
             {
                 //Does charge exist ? 
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
@@ -447,7 +455,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             try
             {
 
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -507,7 +515,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             int statusCode = StatusCodes.Status500InternalServerError ;
             try
             {
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -620,7 +628,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
                     }
                 }
 
-                statusCode = HttpStatusCode.OK;
+                statusCode = StatusCodes.Status200OK;
                 result.SerialNo = uuid;
 
             }
@@ -662,7 +670,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -770,7 +778,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             int statusCode = StatusCodes.Status500InternalServerError ;
             try
             {
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -891,7 +899,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -976,7 +984,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1061,7 +1069,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1191,7 +1199,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
                             Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT 
                         });
                 }
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1259,7 +1267,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1334,7 +1342,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1447,7 +1455,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1532,7 +1540,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1614,7 +1622,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             int statusCode = StatusCodes.Status200OK;
             try
             {
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1697,7 +1705,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             try
             {
 
-                ChargePointService chargePointService = new ChargePointService();
+                ChargePointService chargePointService = serviceProvider.GetRequiredService<ChargePointService>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1782,7 +1790,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version1
             bool result = false;
             try
             {
-                ServerTriggerService service = new ServerTriggerService();
+                ServerTriggerService service = serviceProvider.GetRequiredService<ServerTriggerService>();//new ServerTriggerService();
                 service.AddMessage(chargeBoxId, uuid, request);
                 result = true;
             }

+ 33 - 26
EVCB_OCPP.WEBAPI/Controllers/Version2/V2_CPOController.cs

@@ -23,15 +23,23 @@ using CommandType = EVCB_OCPP.WEBAPI.Models.WebAPI.Dto.CommandType;
 using IChargePointService = EVCB_OCPP.WEBAPI.Services.Integration.IChargePointService;
 using Microsoft.Extensions.Configuration;
 using Microsoft.AspNetCore.Http.Extensions;
+using Microsoft.Extensions.DependencyInjection;
 
 namespace EVCB_OCPP.WEBAPI.Controllers.Version2
 {    
 
     [ApiExplorerSettings(IgnoreApi = false)]
     [Route("api/v2/cpo")]
-    [CPOAuthentication]
+    [ServiceFilter(typeof(CPOAuthentication))]
     public class V2_CPOController : ControllerBase
     {
+        private readonly IServiceProvider serviceProvider;
+
+        public V2_CPOController(IServiceProvider serviceProvider)
+        {
+            this.serviceProvider = serviceProvider;
+        }
+
         [Route("information")]
         [Produces(typeof(CPOOuterResponse))]
         [HttpGet]
@@ -50,7 +58,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
                     var _customerId = Request.Headers[EVCBConfiguration.Header_PartnerId].First();
 
                     var _innerResponse = new { EVSEs = new List<EVSE>() };
-                    ChargingStationService _stationService = new ChargingStationService();
+                    ChargingStationService _stationService = serviceProvider.GetRequiredService<ChargingStationService>();
 
                     if (StationId > -1)
                     {
@@ -78,11 +86,11 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
                         IChargePointService _service = null;
                         if (GetChargePointOCPPProtocol(ChargeBoxId) == OCPPProtocolType.OCPP16)
                         {
-                            _service = new ChargePoint16Service();
+                            _service = serviceProvider.GetRequiredService<ChargePoint16Service>();
                         }
                         else
                         {
-                            _service = new ChargePoint201Service();
+                            _service = serviceProvider.GetRequiredService<ChargePoint201Service>();
                         }
                         _innerResponse = new { EVSEs = new List<EVSE>() };
                         _innerResponse.EVSEs.Add(_service.GetEVSEsbyChargeBoxId(ChargeBoxId, DateFrom, DateTo));
@@ -123,7 +131,6 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
                 if (Request.Headers.Keys.Contains(EVCBConfiguration.Header_PartnerId))
                 {
                     var customerId = Request.Headers[EVCBConfiguration.Header_PartnerId].First();
-                    //string mainConnectionString = ConfigurationManager.ConnectionStrings["MainDBContext"].ConnectionString;
                     string mainConnectionString = configuration.GetConnectionString("MainDBContext");
                     var parameters = new DynamicParameters();
                     parameters.Add("@CustomerId", customerId, DbType.String, ParameterDirection.Input);
@@ -169,7 +176,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
 
             try
             {
-                ChargingStationService service = new ChargingStationService();
+                ChargingStationService service = serviceProvider.GetRequiredService<ChargingStationService>();
 
                 var _innerData = service.GetInfobyChargeBoxId(ChargeBoxId);
 
@@ -213,11 +220,11 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
                 IChargePointService _service = null;
                 if (GetChargePointOCPPProtocol(ChargeBoxId) == OCPPProtocolType.OCPP16)
                 {
-                    _service = new ChargePoint16Service();
+                    _service = serviceProvider.GetRequiredService<ChargePoint16Service>();
                 }
                 else
                 {
-                    _service = new ChargePoint201Service();
+                    _service = serviceProvider.GetRequiredService<ChargePoint201Service>();
                 }
 
                 result.Data = _service.GetVersionbyChargeBoxId(ChargeBoxId);
@@ -251,7 +258,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
                 if (Request.Headers.Keys.Contains(EVCBConfiguration.Header_PartnerId))
                 {
                     var _customerId = Request.Headers[EVCBConfiguration.Header_PartnerId].First();
-                    ChargingStationService _service = new ChargingStationService();
+                    ChargingStationService _service = serviceProvider.GetRequiredService<ChargingStationService>();
                     var _innerResponse = new { Stations = _service.GetStationsbyCustomerId(_customerId) };
                     result.Data = JsonConvert.SerializeObject(_innerResponse, EVCBConfiguration.JSONSERIALIZER_FORMAT);
                     result.StatusCode = (int)CPO_StatusCode.Success;
@@ -299,11 +306,11 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
                 IChargePointService _service = null;
                 if (GetChargePointOCPPProtocol(request.ChargeBoxId) == OCPPProtocolType.OCPP16)
                 {
-                    _service = new ChargePoint16Service();
+                    _service = serviceProvider.GetRequiredService<ChargePoint16Service>();
                 }
                 else
                 {
-                    _service = new ChargePoint201Service();
+                    _service = serviceProvider.GetRequiredService<ChargePoint201Service>();
                 }
 
                 if (!string.IsNullOrEmpty(request.ChargeBoxId) && request.ChargeBoxId.Length <= 25 && (!request.ConnectorId.HasValue
@@ -312,7 +319,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
                 {
 
                     InternalHttpClient _client = new InternalHttpClient();
-                    CustomerService _customer = new CustomerService();
+                    ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
                     //trigger to charge
                     var _request = new Models.WebAPI.StartTransactionRequest()
@@ -404,7 +411,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
                 }
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
                 string[] parts = Request.GetDisplayUrl().Split('/');
 
@@ -485,7 +492,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
                 string[] parts = Request.GetDisplayUrl().Split('/');
                 string urlformat = "{0}//{1}/api/v1/ocpp{2}/reservation?ChargeBoxId={3}";
@@ -573,7 +580,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
                 string[] parts = Request.GetDisplayUrl().ToString().Split('/');
@@ -655,7 +662,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
 
@@ -739,7 +746,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
 
@@ -823,7 +830,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
                 }
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
                 int? orderNo = (int?)null;
 
@@ -1011,11 +1018,11 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
                 IChargePointService _service = null;
                 if (GetChargePointOCPPProtocol(ChargeBoxId) == OCPPProtocolType.OCPP16)
                 {
-                    _service = new ChargePoint16Service();
+                    _service = serviceProvider.GetRequiredService<ChargePoint16Service>();
                 }
                 else
                 {
-                    _service = new ChargePoint201Service();
+                    _service = serviceProvider.GetRequiredService<ChargePoint201Service>();
                 }
                 var transactionDatas = _service.GetActiveSessionInfo(ChargeBoxId, new List<Measurand>()
                 {  Measurand.Voltage,
@@ -1117,11 +1124,11 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
                 IChargePointService _service = null;
                 if (GetChargePointOCPPProtocol(ChargeBoxId) == OCPPProtocolType.OCPP16)
                 {
-                    _service = new ChargePoint16Service();
+                    _service = serviceProvider.GetRequiredService<ChargePoint16Service>();
                 }
                 else
                 {
-                    _service = new ChargePoint201Service();
+                    _service = serviceProvider.GetRequiredService<ChargePoint201Service>();
                 }
                 var _innerData = _service.GetSessionDetail(ChargeBoxId, SessionId, IdTag, startDt, stopDt);
 
@@ -1163,8 +1170,8 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
 
             customerId = Request.Headers[EVCBConfiguration.Header_PartnerId].First();
 
-            ChargePoint201Service _service201 = new ChargePoint201Service();
-            ChargePoint16Service _service16 = new ChargePoint16Service();
+            ChargePoint201Service _service201 = serviceProvider.GetRequiredService<ChargePoint201Service>();
+            ChargePoint16Service _service16 = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
 
             return _service16.ContainsChargePoint(chargeBoxId, customerId) ? true : _service201.ContainsChargePoint(chargeBoxId, customerId) ? true : false;
@@ -1174,8 +1181,8 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2
 
         private OCPPProtocolType GetChargePointOCPPProtocol(string chargeBoxId)
         {
-            ChargePoint201Service _service201 = new ChargePoint201Service();
-            ChargePoint16Service _service16 = new ChargePoint16Service();
+            ChargePoint201Service _service201 = serviceProvider.GetRequiredService<ChargePoint201Service>();
+            ChargePoint16Service _service16 = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
             return _service201.GetMachineUpdatedOn(chargeBoxId) > _service16.GetMachineUpdatedOn(chargeBoxId)
                 ? OCPPProtocolType.OCPP201 : OCPPProtocolType.OCPP16;

+ 56 - 49
EVCB_OCPP.WEBAPI/Controllers/Version2/ocpp16/OCPP16_CPOController.cs

@@ -23,15 +23,23 @@ using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Http.Extensions;
 using Microsoft.Extensions.Configuration;
 using System.Security.Policy;
+using Microsoft.Extensions.DependencyInjection;
 
 namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
 {
+    [ServiceFilter(typeof(CPOAuthentication))]
     [ApiExplorerSettings(IgnoreApi = false)]
     [Route("api/v2/cpo16")]
-    [CPOAuthentication]
+    //[CPOAuthentication]
     public class OCPP16_CPOController : ControllerBase
     {
         private HttpClientService service = new HttpClientService();
+        private readonly IServiceProvider serviceProvider;
+
+        public OCPP16_CPOController(IServiceProvider serviceProvider)
+        {
+            this.serviceProvider = serviceProvider;
+        }
 
         private bool ContainsChargePoint(string chargeBoxId, out string customerId)
         {
@@ -42,7 +50,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
 
             customerId = Request.Headers[EVCBConfiguration.Header_PartnerId].First();
 
-            ChargePoint16Service _service = new ChargePoint16Service();
+            ChargePoint16Service _service = serviceProvider.GetRequiredService<ChargePoint16Service>();
             return _service.ContainsChargePoint(chargeBoxId, customerId);
 
         }
@@ -52,7 +60,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
         [Route("station")]
         [Produces(typeof(CPOOuterResponse))]
         [HttpGet]
-        public IActionResult Station()
+        public IActionResult Station([FromServices]IServiceProvider serviceProvider)
         {
             var result = new CPOOuterResponse();
             //HttpStatusCodeHttpStatusCode statusCode = HttpStatusCode.InternalServerError;
@@ -62,7 +70,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
                 if (Request.Headers.Keys.Contains(EVCBConfiguration.Header_PartnerId))
                 {
                     var _customerId = Request.Headers[EVCBConfiguration.Header_PartnerId].First();
-                    ChargingStationService _service = new ChargingStationService();
+                    ChargingStationService _service = serviceProvider.GetRequiredService<ChargingStationService>();//new ChargingStationService();
                     var _innerResponse = new { Stations = _service.GetStationsbyCustomerId(_customerId) };
                     result.Data = JsonConvert.SerializeObject(_innerResponse, EVCBConfiguration.JSONSERIALIZER_FORMAT);
                     result.StatusCode = (int)CPO_StatusCode.Success;
@@ -92,14 +100,14 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint16Service _CPService = new ChargePoint16Service();
+                ChargePoint16Service _CPService = serviceProvider.GetRequiredService<ChargePoint16Service>();
                 var tt = _CPService.GetLastUpdatedTimebyMachineId("0da4f4a6-a952-46f0-b2f3-696385a9a56a");
                 if (Request.Headers.Keys.Contains(EVCBConfiguration.Header_PartnerId))
                 {
                     var _customerId = Request.Headers[EVCBConfiguration.Header_PartnerId].First();
 
                     var _innerResponse = new { EVSEs = new List<EVSE>() };
-                    ChargingStationService _stationService = new ChargingStationService();
+                    ChargingStationService _stationService = serviceProvider.GetRequiredService<ChargingStationService>();
 
                     if (StationId > -1)
                     {
@@ -177,7 +185,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
                     return StatusCode(statusCode, result);
                 }
 
-                ChargePoint16Service _CPService = new ChargePoint16Service();
+                ChargePoint16Service _CPService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!string.IsNullOrEmpty(request.ChargeBoxId) && request.ChargeBoxId.Length <= 25
                    && _CPService.GetNumberofConnectors(request.ChargeBoxId) >= request.ConnectorId && request.ConnectorId > 0
@@ -185,7 +193,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
                 {
 
                     InternalHttpClient _client = new InternalHttpClient();
-                    CustomerService _customer = new CustomerService();
+                    ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
                     //trigger to charge
                     var _request = new Models.WebAPI.StartTransactionRequest()
@@ -281,7 +289,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
                 string[] parts = Request.GetDisplayUrl().Split('/');
 
@@ -354,7 +362,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
                 string[] parts = Request.GetDisplayUrl().Split('/');
                 string urlformat = "{0}//{1}/api/v1/ocpp16/reservation?ChargeBoxId={2}";
@@ -432,7 +440,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
                 string[] parts = Request.GetDisplayUrl().Split('/');
@@ -503,7 +511,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
                 string[] parts = Request.GetDisplayUrl().Split('/');
@@ -575,7 +583,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
                 string[] parts = Request.GetDisplayUrl().Split('/');
@@ -608,7 +616,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
                     //statusCode = HttpStatusCode.BadRequest;
                     statusCode = StatusCodes.Status400BadRequest;
                 }
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -654,7 +662,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
                 string[] parts = Request.GetDisplayUrl().Split('/');
@@ -725,7 +733,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
 
@@ -781,7 +789,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
         {
             var result = new CPOOuterResponse();
             //HttpStatusCode statusCode = HttpStatusCode.InternalServerError;
-            int statusCode = StatusCodes.InternalServerError;
+            int statusCode = StatusCodes.Status500InternalServerError;
             var _innerData = new { Result = CommandResponseType.Rejected.ToString(), Timeout = 60 };
             try
             {
@@ -800,7 +808,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
 
@@ -877,7 +885,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
                 int? orderNo = (int?)null;
 
@@ -1052,7 +1060,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
 
             try
             {
-                ChargePoint16Service _service = new ChargePoint16Service();
+                ChargePoint16Service _service = serviceProvider.GetRequiredService<ChargePoint16Service>();
                 string version = _service.GetVersionbyChargeBoxId(ChargeBoxId);
 
                 result.Data = version;
@@ -1098,7 +1106,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
                 }
 
                 // query meter value
-                ChargePoint16Service _service = new ChargePoint16Service();
+                ChargePoint16Service _service = serviceProvider.GetRequiredService<ChargePoint16Service>();
                 var transactionDatas = _service.GetActiveSessionInfo(ChargeBoxId, new List<Packet.Messages.SubTypes.Measurand>()
                 {   Packet.Messages.SubTypes.Measurand.Voltage,
                     Packet.Messages.SubTypes.Measurand.Current_Import,
@@ -1191,7 +1199,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
                 DateTime startDt = string.IsNullOrEmpty(StartTime) ? new DateTime(1991, 1, 1) : DateTime.Parse(StartTime);
                 DateTime stopDt = string.IsNullOrEmpty(StopTime) ? new DateTime(1991, 1, 1) : DateTime.Parse(StopTime);
                 // query meter value
-                ChargePoint16Service _service = new ChargePoint16Service();
+                ChargePoint16Service _service = serviceProvider.GetRequiredService<ChargePoint16Service>();
                 var _innerData = _service.GetSessionDetail(ChargeBoxId, SessionId, IdTag, startDt, stopDt);
 
                 if (_innerData == null)
@@ -1235,9 +1243,8 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             {
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
-                //string url = System.Web.Configuration.WebConfigurationManager.AppSettings["StatisticsAPI"] + 1;
                 string url = configuration["StatisticsAPI"] + 1;
                 string chargeBoxIds = GetStatisticChargeBoxIds(request.ChargeBoxIds);
 
@@ -1254,7 +1261,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
                 var _innerresult = await service.PostFormDataAsync(url, postData, null);
 
 
-                if (_innerresult.StatusCode == StatusCodes.Status200OK)
+                if (_innerresult.StatusCode == HttpStatusCode.OK)
                 {
                     _innerresult.Response = _innerresult.Response.Replace("item", "Title");
                     _innerresult.Response = _innerresult.Response.Replace("Data", "Count");
@@ -1286,7 +1293,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
         [Route("statistics/energy_delivered")]
         [Produces(typeof(CPOOuterResponse))]
         [HttpPost]
-        async public Task<IActionResult> Energy_Delivered([FromBody] StatisticsRequest request)
+        async public Task<IActionResult> Energy_Delivered([FromBody] StatisticsRequest request, [FromServices]IConfiguration configuration)
         {
             var result = new CPOOuterResponse();
             //HttpStatusCode statusCode = HttpStatusCode.InternalServerError;
@@ -1296,9 +1303,9 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             {
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
-                string url = System.Web.Configuration.WebConfigurationManager.AppSettings["StatisticsAPI"] + 2;
+                string url = configuration["StatisticsAPI"] + 2;
                 string chargeBoxIds = GetStatisticChargeBoxIds(request.ChargeBoxIds);
 
                 HttpClientService service = new HttpClientService();
@@ -1314,7 +1321,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
                 var _innerresult = await service.PostFormDataAsync(url, postData, null);
 
 
-                if (_innerresult.StatusCode == StatusCodes.Status200OK)
+                if (_innerresult.StatusCode == HttpStatusCode.OK)
                 {
                     _innerresult.Response = _innerresult.Response.Replace("item", "Title");
                     _innerresult.Response = _innerresult.Response.Replace("Data", "DeliveredEnergy");
@@ -1346,7 +1353,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
         [Route("statistics/time_of_use")]
         [Produces(typeof(CPOOuterResponse))]
         [HttpPost]
-        async public Task<IActionResult> Time_of_Use([FromBody] StatisticsRequest request)
+        async public Task<IActionResult> Time_of_Use([FromBody] StatisticsRequest request, [FromServices] IConfiguration configuration)
         {
             var result = new CPOOuterResponse();
             //HttpStatusCode statusCode = HttpStatusCode.InternalServerError;
@@ -1356,9 +1363,9 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             {
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
-                string url = System.Web.Configuration.WebConfigurationManager.AppSettings["StatisticsAPI"] + 3;
+                string url = configuration["StatisticsAPI"] + 3;
                 string chargeBoxIds = GetStatisticChargeBoxIds(request.ChargeBoxIds);
 
                 HttpClientService service = new HttpClientService();
@@ -1373,7 +1380,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
                 var _innerresult = await service.PostFormDataAsync(url, postData, null);
 
 
-                if (_innerresult.StatusCode == StatusCodes.Status200OK)
+                if (_innerresult.StatusCode == HttpStatusCode.OK)
                 {
                     _innerresult.Response = _innerresult.Response.Replace("item", "Title");
                     _innerresult.Response = _innerresult.Response.Replace("data", "Count");
@@ -1406,7 +1413,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
         [Route("statistics/peak_load")]
         [Produces(typeof(CPOOuterResponse))]
         [HttpPost]
-        async public Task<IActionResult> Peak_Load([FromBody] StatisticsRequest request)
+        async public Task<IActionResult> Peak_Load([FromBody] StatisticsRequest request, [FromServices] IConfiguration configuration)
         {
             var result = new CPOOuterResponse();
             //HttpStatusCode statusCode = HttpStatusCode.InternalServerError;
@@ -1416,9 +1423,9 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             {
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
-                string url = System.Web.Configuration.WebConfigurationManager.AppSettings["StatisticsAPI"] + 4;
+                string url = configuration["StatisticsAPI"] + 4;
                 string chargeBoxIds = GetStatisticChargeBoxIds(request.ChargeBoxIds);
 
                 HttpClientService service = new HttpClientService();
@@ -1433,7 +1440,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
                 var _innerresult = await service.PostFormDataAsync(url, postData, null);
 
 
-                if (_innerresult.StatusCode == StatusCodes.Status200OK)
+                if (_innerresult.StatusCode == HttpStatusCode.OK)
                 {
                     _innerresult.Response = _innerresult.Response.Replace("item", "Title");
                     _innerresult.Response = _innerresult.Response.Replace("data", "DeliveredEnergy");
@@ -1465,7 +1472,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
         [Route("statistics/sessions")]
         [Produces(typeof(CPOOuterResponse))]
         [HttpPost]
-        async public Task<IActionResult> Sessions([FromBody] StatisticsRequest request)
+        async public Task<IActionResult> Sessions([FromBody] StatisticsRequest request, [FromServices] IConfiguration configuration)
         {
             var result = new CPOOuterResponse();
             //HttpStatusCode statusCode = HttpStatusCode.InternalServerError;
@@ -1475,9 +1482,9 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             {
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
-                string url = System.Web.Configuration.WebConfigurationManager.AppSettings["StatisticsAPI"] + 6;
+                string url = configuration["StatisticsAPI"] + 6;
                 string chargeBoxIds = GetStatisticChargeBoxIds(request.ChargeBoxIds);
 
                 HttpClientService service = new HttpClientService();
@@ -1492,7 +1499,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
                 var _innerresult = await service.PostFormDataAsync(url, postData, null);
 
 
-                if (_innerresult.StatusCode == StatusCodes.Status200OK)
+                if (_innerresult.StatusCode == HttpStatusCode.OK)
                 {
                     string titles = "\"Title\":[\"ChargeBox Id\",\"Connector Id\",\"Session Id\",\"DateFrom\",\"DateTo\",\"Duration(sec)\",\"Energy(kWh)\",\"Stop Reason\"],";
 
@@ -1526,7 +1533,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
         [Route("statistics/fault")]
         [Produces(typeof(CPOOuterResponse))]
         [HttpPost]
-        async public Task<IActionResult> Fault([FromBody] StatisticsRequest request)
+        async public Task<IActionResult> Fault([FromBody] StatisticsRequest request, [FromServices] IConfiguration configuration)
         {
             var result = new CPOOuterResponse();
             //HttpStatusCode statusCode = HttpStatusCode.InternalServerError;
@@ -1536,9 +1543,9 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             {
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
-                string url = System.Web.Configuration.WebConfigurationManager.AppSettings["StatisticsAPI"] + 5;
+                string url = configuration["StatisticsAPI"] + 5;
                 string chargeBoxIds = GetStatisticChargeBoxIds(request.ChargeBoxIds);
 
                 HttpClientService service = new HttpClientService();
@@ -1553,7 +1560,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
                 var _innerresult = await service.PostFormDataAsync(url, postData, null);
 
 
-                if (_innerresult.StatusCode == StatusCodes.Status200OK)
+                if (_innerresult.StatusCode == HttpStatusCode.OK)
                 {
                     _innerresult.Response = _innerresult.Response.Replace("item", "Title");
                     _innerresult.Response = _innerresult.Response.Replace("data", "Count");
@@ -1609,7 +1616,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
                 }
 
 
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1673,7 +1680,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
                 }
 
 
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1736,7 +1743,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
                 }
 
 
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1783,7 +1790,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             bool result = false;
             try
             {
-                ServerTriggerService service = new ServerTriggerService();
+                ServerTriggerService service = serviceProvider.GetRequiredService<ServerTriggerService>();
                 service.AddMessage(chargeBoxId, uuid, request);
                 result = true;
             }

+ 30 - 22
EVCB_OCPP.WEBAPI/Controllers/Version2/ocpp16/OCPP16_InternalController.cs

@@ -12,6 +12,7 @@ using EVCB_OCPP.WEBAPI.Services;
 using EVCB_OCPP.WEBAPI.Services.Integration;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.DependencyInjection;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using System;
@@ -28,9 +29,16 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
 {
     [ApiExplorerSettings(IgnoreApi = false)]
     [Route("api/v2/ocpp16")]
-    [InernalAuthentication]
+    //[InernalAuthentication]
+    [ServiceFilter(typeof(InernalAuthentication))]
     public class OCPP16_InternalController : ControllerBase
     {
+        private readonly IServiceProvider serviceProvider;
+
+        public OCPP16_InternalController(IServiceProvider serviceProvider)
+        {
+            this.serviceProvider = serviceProvider;
+        }
 
         [Route("command")]
         //[Produces(typeof(ErrorResponse))]
@@ -44,7 +52,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             try
             {
 
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!IsValidEnum<Internal_Actions>(OrderNo) || string.IsNullOrEmpty(ChargeBoxId))
                 {
@@ -56,7 +64,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
                     return StatusCode(StatusCodes.Status400BadRequest, new ErrorResponse() { Code = 2101, Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
                 }
 
-                ServerTriggerService triggerService = new ServerTriggerService();
+                ServerTriggerService triggerService = serviceProvider.GetRequiredService<ServerTriggerService>();
                 var excution = triggerService.GetExecution(SerialNo, (Internal_Actions)OrderNo, ChargeBoxId);
 
                 if (excution == null)
@@ -94,7 +102,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             try
             {
 
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -157,7 +165,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             try
             {
                 //Does charge exist ? 
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
@@ -218,7 +226,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             {
 
                 //Does charge exist ? 
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -275,7 +283,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             try
             {
                 //Does charge exist ? 
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
@@ -342,7 +350,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             try
             {
 
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -386,7 +394,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -503,7 +511,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -579,7 +587,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -667,7 +675,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -728,7 +736,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -789,7 +797,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -879,7 +887,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
                 {
                     return StatusCode(StatusCodes.Status400BadRequest, new ErrorResponse() { Code = 2100, Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
                 }
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -929,7 +937,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -985,7 +993,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1069,7 +1077,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1132,7 +1140,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1191,7 +1199,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1252,7 +1260,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             try
             {
 
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1309,7 +1317,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp16
             bool result = false;
             try
             {
-                ServerTriggerService service = new ServerTriggerService();
+                ServerTriggerService service = serviceProvider.GetRequiredService<ServerTriggerService>();
                 service.AddMessage(chargeBoxId, uuid, request);
                 result = true;
             }

+ 15 - 7
EVCB_OCPP.WEBAPI/Controllers/Version2/ocpp201/OCPP201_CPOController.cs

@@ -22,15 +22,23 @@ using CommandType = EVCB_OCPP.WEBAPI.Models.WebAPI.Dto.CommandType;
 using ReserveNowRequest = EVCB_OCPP.WEBAPI.Models.WebAPI.Dto.ReserveNowRequest;
 using ServerTriggerService = EVCB_OCPP.WEBAPI.Services.Integration.ServerTriggerService;
 using Microsoft.AspNetCore.Http.Extensions;
+using Microsoft.Extensions.DependencyInjection;
 
 namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
 {
     [ApiExplorerSettings(IgnoreApi = false)]
     [Route("api/v2/cpo201")]
-    [CPOAuthentication]
+    [ServiceFilter(typeof(CPOAuthentication))]
+    //[CPOAuthentication]
     public class OCPP201_CPOController : ControllerBase
     {
         private HttpClientService service = new HttpClientService();
+        private readonly IServiceProvider serviceProvider;
+
+        public OCPP201_CPOController(IServiceProvider serviceProvider)
+        {
+            this.serviceProvider = serviceProvider;
+        }
 
         private bool ContainsChargePoint(string chargeBoxId, out string customerId)
         {
@@ -40,7 +48,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
 
             customerId = Request.Headers[EVCBConfiguration.Header_PartnerId].First();
 
-            ChargePoint201Service _service = new ChargePoint201Service();
+            ChargePoint201Service _service = serviceProvider.GetRequiredService<ChargePoint201Service>();
             return _service.ContainsChargePoint(chargeBoxId, customerId);
 
         }
@@ -72,7 +80,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
                 string[] parts = Request.GetDisplayUrl().Split('/');
@@ -105,7 +113,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
                     //statusCode = HttpStatusCode.BadRequest;
                     statusCode = StatusCodes.Status400BadRequest;
                 }
-                ChargePoint201Service ChargePoint201Service = new ChargePoint201Service();
+                ChargePoint201Service ChargePoint201Service = serviceProvider.GetRequiredService<ChargePoint201Service>();
 
                 if (!ChargePoint201Service.IsOnline(ChargeBoxId))
                 {
@@ -153,7 +161,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
                 string[] parts = Request.GetDisplayUrl().Split('/');
@@ -224,7 +232,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
 
 
                 InternalHttpClient _client = new InternalHttpClient();
-                CustomerService _customer = new CustomerService();
+                ICustomerService _customer = serviceProvider.GetRequiredService<ICustomerService>();
 
 
                 string[] parts = Request.GetDisplayUrl().Split('/');
@@ -283,7 +291,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
             bool result = false;
             try
             {
-                ServerTriggerService service = new ServerTriggerService();
+                ServerTriggerService service = serviceProvider.GetRequiredService<ServerTriggerService>();
                 service.AddMessage(chargeBoxId, uuid, request);
                 result = true;
             }

+ 29 - 20
EVCB_OCPP.WEBAPI/Controllers/Version2/ocpp201/OCPP201_InternalController.cs

@@ -14,14 +14,23 @@ using EVCB_OCPP20.Packet.DataTypes.EnumTypes;
 using EVCB_OCPP.Packet.Messages.SubTypes;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.DependencyInjection;
 
 namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
 {
     [ApiExplorerSettings(IgnoreApi = false)]
     [Route("api/v2/ocpp20")]
-    [InernalAuthentication]
+    //[InernalAuthentication]
+    [ServiceFilter(typeof(InernalAuthentication))]
     public class OCPP201_InternalController : ControllerBase
     {
+        private readonly IServiceProvider serviceProvider;
+
+        public OCPP201_InternalController(IServiceProvider serviceProvider)
+        {
+            this.serviceProvider = serviceProvider;
+        }
+
         [Route("command")]
         ////[Produces(typeof(ErrorResponse))]
         [Produces(typeof(InternalGenericResponse))]
@@ -35,7 +44,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
             try
             {
 
-                ChargePoint201Service ChargePoint201Service = new ChargePoint201Service();
+                ChargePoint201Service ChargePoint201Service = serviceProvider.GetRequiredService<ChargePoint201Service>();
 
                 if (!IsValidEnum<Internal_Actions>(OrderNo) || string.IsNullOrEmpty(ChargeBoxId))
                 {
@@ -47,7 +56,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
                     return StatusCode(StatusCodes.Status400BadRequest, new ErrorResponse() { Code = 2101, Message = EVCBConfiguration.ERROR_MSG_CHARGEBOXID_ISNT_EXIST_OR_OFFLINE });
                 }
 
-                ServerTriggerService triggerService = new ServerTriggerService();
+                ServerTriggerService triggerService = serviceProvider.GetRequiredService<ServerTriggerService>();
                 var excution = triggerService.GetExecution_ocpp201(SerialNo, (Internal_Actions)OrderNo, ChargeBoxId);
 
                 if (excution == null)
@@ -85,7 +94,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
             try
             {
 
-                ChargePoint201Service ChargePoint201Service = new ChargePoint201Service();
+                ChargePoint201Service ChargePoint201Service = serviceProvider.GetRequiredService<ChargePoint201Service>();
 
                 if (!ChargePoint201Service.IsOnline(ChargeBoxId))
                 {
@@ -151,7 +160,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
             try
             {
                 //Does charge exist ? 
-                ChargePoint201Service ChargePoint201Service = new ChargePoint201Service();
+                ChargePoint201Service ChargePoint201Service = serviceProvider.GetRequiredService<ChargePoint201Service>();
 
 
                 if (!ChargePoint201Service.IsOnline(ChargeBoxId))
@@ -222,7 +231,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint201Service ChargePoint201Service = new ChargePoint201Service();
+                ChargePoint201Service ChargePoint201Service = serviceProvider.GetRequiredService<ChargePoint201Service>();
 
                 if (!ChargePoint201Service.IsOnline(ChargeBoxId))
                 {
@@ -361,7 +370,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint201Service ChargePoint201Service = new ChargePoint201Service();
+                ChargePoint201Service ChargePoint201Service = serviceProvider.GetRequiredService<ChargePoint201Service>();
 
                 if (!ChargePoint201Service.IsOnline(ChargeBoxId))
                 {
@@ -437,7 +446,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint201Service ChargePoint201Service = new ChargePoint201Service();
+                ChargePoint201Service ChargePoint201Service = serviceProvider.GetRequiredService<ChargePoint201Service>();
 
                 if (!ChargePoint201Service.IsOnline(ChargeBoxId))
                 {
@@ -524,7 +533,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint201Service ChargePoint201Service = new ChargePoint201Service();
+                ChargePoint201Service ChargePoint201Service = serviceProvider.GetRequiredService<ChargePoint201Service>();
 
                 if (!ChargePoint201Service.IsOnline(ChargeBoxId))
                 {
@@ -591,7 +600,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint201Service ChargePoint201Service = new ChargePoint201Service();
+                ChargePoint201Service ChargePoint201Service = serviceProvider.GetRequiredService<ChargePoint201Service>();
 
                 if (!ChargePoint201Service.IsOnline(ChargeBoxId))
                 {
@@ -658,7 +667,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
                 {
                     return StatusCode(StatusCodes.Status400BadRequest, new ErrorResponse() { Code = 2100, Message = EVCBConfiguration.ERROR_MSG_PARAMETER_OUTOFRANGE_INCORRECT });
                 }
-                ChargePoint201Service ChargePoint201Service = new ChargePoint201Service();
+                ChargePoint201Service ChargePoint201Service = serviceProvider.GetRequiredService<ChargePoint201Service>();
 
                 if (!ChargePoint201Service.IsOnline(ChargeBoxId))
                 {
@@ -708,7 +717,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint201Service ChargePoint201Service = new ChargePoint201Service();
+                ChargePoint201Service ChargePoint201Service = serviceProvider.GetRequiredService<ChargePoint201Service>();
 
                 if (!ChargePoint201Service.IsOnline(ChargeBoxId))
                 {
@@ -770,7 +779,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint201Service ChargePoint201Service = new ChargePoint201Service();
+                ChargePoint201Service ChargePoint201Service = serviceProvider.GetRequiredService<ChargePoint201Service>();
 
                 if (!ChargePoint201Service.IsOnline(ChargeBoxId))
                 {
@@ -878,7 +887,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint201Service ChargePoint201Service = new ChargePoint201Service();
+                ChargePoint201Service ChargePoint201Service = serviceProvider.GetRequiredService<ChargePoint201Service>();
 
                 if (!ChargePoint201Service.IsOnline(ChargeBoxId))
                 {
@@ -952,7 +961,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint201Service ChargePoint201Service = new ChargePoint201Service();
+                ChargePoint201Service ChargePoint201Service = serviceProvider.GetRequiredService<ChargePoint201Service>();
 
                 if (!ChargePoint201Service.IsOnline(ChargeBoxId))
                 {
@@ -1011,7 +1020,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint201Service ChargePoint201Service = new ChargePoint201Service();
+                ChargePoint201Service ChargePoint201Service = serviceProvider.GetRequiredService<ChargePoint201Service>();
 
                 if (!ChargePoint201Service.IsOnline(ChargeBoxId))
                 {
@@ -1064,14 +1073,14 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
         //[Produces(typeof(ErrorResponse))]
         [Produces(typeof(InternalGenericResponse))]
         [HttpPost]
-        public IActionResult SendLocalList(string ChargeBoxId, [FromBody] LocalListRequest LocalList)
+        public IActionResult SendLocalList(string ChargeBoxId, [FromBody] LocalListRequest LocalList, [FromServices] IServiceProvider serviceProvider)
         {
             string uuid = Guid.NewGuid().ToString();
             var result = new InternalGenericResponse();
             int statusCode = StatusCodes.Status500InternalServerError;
             try
             {
-                ChargePoint16Service chargePointService = new ChargePoint16Service();
+                ChargePoint16Service chargePointService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1168,7 +1177,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
             try
             {
 
-                ChargePoint201Service chargePointService = new ChargePoint201Service();
+                ChargePoint201Service chargePointService = serviceProvider.GetRequiredService<ChargePoint201Service>();
 
                 if (!chargePointService.IsOnline(ChargeBoxId))
                 {
@@ -1207,7 +1216,7 @@ namespace EVCB_OCPP.WEBAPI.Controllers.Version2.ocpp201
             bool result = false;
             try
             {
-                ServerTriggerService service = new ServerTriggerService();
+                ServerTriggerService service = serviceProvider.GetRequiredService<ServerTriggerService>();
                 service.AddMessage(chargeBoxId, uuid, request);
                 result = true;
             }

+ 7 - 3
EVCB_OCPP.WEBAPI/EVCB_OCPP.WEBAPI.csproj

@@ -2,6 +2,13 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
   </PropertyGroup>
+  <ItemGroup>
+    <Antlr4 Remove="App_Data\**" />
+    <Compile Remove="App_Data\**" />
+    <Content Remove="App_Data\**" />
+    <EmbeddedResource Remove="App_Data\**" />
+    <None Remove="App_Data\**" />
+  </ItemGroup>
   <ItemGroup>
     <Reference Include="EVCB_OCPP.Packet, Version=0.1.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
@@ -33,9 +40,6 @@
       <DependentUpon>Web.config</DependentUpon>
     </Content>
   </ItemGroup>
-  <ItemGroup>
-    <Folder Include="App_Data\" />
-  </ItemGroup>
   <ItemGroup>
     <PackageReference Include="bootstrap" Version="5.2.2" />
     <PackageReference Include="Dapper" Version="2.0.123" />

+ 16 - 16
EVCB_OCPP.WEBAPI/Global.asax.cs

@@ -5,25 +5,25 @@ using System.Linq;
 
 namespace EVCB_OCPP.WEBAPI
 {
-    public class WebApiApplication : System.Web.HttpApplication
-    {
-        protected void Application_Start()
-        {
-            AreaRegistration.RegisterAllAreas();
-            GlobalConfiguration.Configure(WebApiConfig.Register);
-            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
-            RouteConfig.RegisterRoutes(RouteTable.Routes);
-            BundleConfig.RegisterBundles(BundleTable.Bundles);
+    //public class WebApiApplication : System.Web.HttpApplication
+    //{
+    //    protected void Application_Start()
+    //    {
+    //        AreaRegistration.RegisterAllAreas();
+    //        GlobalConfiguration.Configure(WebApiConfig.Register);
+    //        FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
+    //        RouteConfig.RegisterRoutes(RouteTable.Routes);
+    //        BundleConfig.RegisterBundles(BundleTable.Bundles);
 
 
-            var formatter = GlobalConfiguration.Configuration.Formatters.JsonFormatter;
-            formatter.SerializerSettings = new JsonSerializerSettings
-            {
+    //        var formatter = GlobalConfiguration.Configuration.Formatters.JsonFormatter;
+    //        formatter.SerializerSettings = new JsonSerializerSettings
+    //        {
                
-                NullValueHandling = NullValueHandling.Ignore
-            };
-        }
+    //            NullValueHandling = NullValueHandling.Ignore
+    //        };
+    //    }
 
      
-    }
+    //}
 }

+ 185 - 185
EVCB_OCPP.WEBAPI/Handlers/APILogHandler.cs

@@ -14,200 +14,200 @@ using System.Threading.Tasks;
 
 namespace EVCB_OCPP.WEBAPI.Handlers
 {
-    public class APILogHandler : DelegatingHandler
-    {
-        public class ApiLogHandler : DelegatingHandler
-        {
-            //   private NLog.ILogger logger = LogManager.GetCurrentClassLogger();
-            private string apiLogConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["APILogDBContext"].ConnectionString;
+    //public class APILogHandler : DelegatingHandler
+    //{
+    //    public class ApiLogHandler : DelegatingHandler
+    //    {
+    //        //   private NLog.ILogger logger = LogManager.GetCurrentClassLogger();
+    //        private string apiLogConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["APILogDBContext"].ConnectionString;
 
 
 
-            protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
-            {
-                string uri = request.RequestUri.ToString();
+    //        protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
+    //        {
+    //            string uri = request.RequestUri.ToString();
 
-                var apiLogEntry = CreateApiLogEntryWithRequestData(request);
+    //            var apiLogEntry = CreateApiLogEntryWithRequestData(request);
 
-                if (request.Content != null)
-                {
-                    await request.Content.ReadAsStringAsync()
-                        .ContinueWith(task =>
-                        {
-                            apiLogEntry.RequestContentBody = task.Result;
+    //            if (request.Content != null)
+    //            {
+    //                await request.Content.ReadAsStringAsync()
+    //                    .ContinueWith(task =>
+    //                    {
+    //                        apiLogEntry.RequestContentBody = task.Result;
 
-                        }, cancellationToken);
-                }
+    //                    }, cancellationToken);
+    //            }
 
 
-                return await base.SendAsync(request, cancellationToken)
-                    .ContinueWith(task =>
-                    {
-                        if(request.RequestUri.AbsolutePath.Contains("api/v1/file"))
-                        {                           
-                            return task.Result;
-                        }
+    //            return await base.SendAsync(request, cancellationToken)
+    //                .ContinueWith(task =>
+    //                {
+    //                    if(request.RequestUri.AbsolutePath.Contains("api/v1/file"))
+    //                    {                           
+    //                        return task.Result;
+    //                    }
                      
-                        if(task.IsFaulted)
-                        {
-                            var result = new CPOOuterResponse() { StatusCode = (int)CPO_StatusCode.UnexpectedError, StatusMessage = CPO_StatusMessage.ERROR_MSG_Global_UNEXPECTEDERROR };
-
-                            apiLogEntry.ResponseContentBody = JsonConvert.SerializeObject(result, EVCBConfiguration.JSONSERIALIZER_FORMAT);
-                            apiLogEntry.ResponseContentType = "";
-                            apiLogEntry.ResponseHeaders = "";
-
-                            apiLogEntry.ErrorOn = DateTime.Now;
-                            apiLogEntry.ErrorMsg = task.Exception.ToString().Replace("'", " ");
-
-                            apiLogEntry.ResponseStatusCode = (int) HttpStatusCode.InternalServerError;
-                            apiLogEntry.ResponseTimestamp = DateTime.Now;
-                            WriteLog(apiLogEntry);
-                            return request.CreateResponse(HttpStatusCode.InternalServerError, result);
-                        }
-                        else
-                        {
-                            var response = task.Result;
-
-                            if (response.Content != null)
-                            {
-                                apiLogEntry.ResponseContentBody = response.Content.ReadAsStringAsync().Result;
-                                apiLogEntry.ResponseContentType = response.Content.Headers.ContentType.MediaType;
-                                apiLogEntry.ResponseHeaders = WebApiHelper.SerializeHeaders(response.Content.Headers);
-                            }
-
-                            int errorMessageIndex = apiLogEntry.ResponseContentBody.IndexOf(",\"ErrorDetail\"");
-                            string endTag = apiLogEntry.ResponseContentBody.Last().ToString();
-
-                            if (errorMessageIndex > 0)
-                            {
-                                string errorMsg = apiLogEntry.ResponseContentBody.Substring(errorMessageIndex).Remove(0, 16);
-                                apiLogEntry.ResponseContentBody = apiLogEntry.ResponseContentBody.Remove(errorMessageIndex).Remove(0, 1);
-                                apiLogEntry.ErrorOn = DateTime.Now;
-                                apiLogEntry.ErrorMsg = errorMsg.Remove(errorMsg.Count() - 2).Replace("'", " ");
-
-                                response = request.CreateResponse(response.StatusCode, JsonConvert.DeserializeObject("{" + apiLogEntry.ResponseContentBody + "}"));
-                            }
-
-                            apiLogEntry.ResponseStatusCode = (int)response.StatusCode;
-                            apiLogEntry.ResponseTimestamp = DateTime.Now;
-                            WriteLog(apiLogEntry);
-
-                            return response;
-                        }
+    //                    if(task.IsFaulted)
+    //                    {
+    //                        var result = new CPOOuterResponse() { StatusCode = (int)CPO_StatusCode.UnexpectedError, StatusMessage = CPO_StatusMessage.ERROR_MSG_Global_UNEXPECTEDERROR };
+
+    //                        apiLogEntry.ResponseContentBody = JsonConvert.SerializeObject(result, EVCBConfiguration.JSONSERIALIZER_FORMAT);
+    //                        apiLogEntry.ResponseContentType = "";
+    //                        apiLogEntry.ResponseHeaders = "";
+
+    //                        apiLogEntry.ErrorOn = DateTime.Now;
+    //                        apiLogEntry.ErrorMsg = task.Exception.ToString().Replace("'", " ");
+
+    //                        apiLogEntry.ResponseStatusCode = (int) HttpStatusCode.InternalServerError;
+    //                        apiLogEntry.ResponseTimestamp = DateTime.Now;
+    //                        WriteLog(apiLogEntry);
+    //                        return request.CreateResponse(HttpStatusCode.InternalServerError, result);
+    //                    }
+    //                    else
+    //                    {
+    //                        var response = task.Result;
+
+    //                        if (response.Content != null)
+    //                        {
+    //                            apiLogEntry.ResponseContentBody = response.Content.ReadAsStringAsync().Result;
+    //                            apiLogEntry.ResponseContentType = response.Content.Headers.ContentType.MediaType;
+    //                            apiLogEntry.ResponseHeaders = WebApiHelper.SerializeHeaders(response.Content.Headers);
+    //                        }
+
+    //                        int errorMessageIndex = apiLogEntry.ResponseContentBody.IndexOf(",\"ErrorDetail\"");
+    //                        string endTag = apiLogEntry.ResponseContentBody.Last().ToString();
+
+    //                        if (errorMessageIndex > 0)
+    //                        {
+    //                            string errorMsg = apiLogEntry.ResponseContentBody.Substring(errorMessageIndex).Remove(0, 16);
+    //                            apiLogEntry.ResponseContentBody = apiLogEntry.ResponseContentBody.Remove(errorMessageIndex).Remove(0, 1);
+    //                            apiLogEntry.ErrorOn = DateTime.Now;
+    //                            apiLogEntry.ErrorMsg = errorMsg.Remove(errorMsg.Count() - 2).Replace("'", " ");
+
+    //                            response = request.CreateResponse(response.StatusCode, JsonConvert.DeserializeObject("{" + apiLogEntry.ResponseContentBody + "}"));
+    //                        }
+
+    //                        apiLogEntry.ResponseStatusCode = (int)response.StatusCode;
+    //                        apiLogEntry.ResponseTimestamp = DateTime.Now;
+    //                        WriteLog(apiLogEntry);
+
+    //                        return response;
+    //                    }
                      
                             
-                    }, cancellationToken);
-            }
-
-            private ApiLogEntry CreateApiLogEntryWithRequestData(HttpRequestMessage request)
-            {
-                try
-                {
-                    HttpContext context = (HttpContext)(request["MS_HttpContext"]);
-                    var routeData = request.GetRouteData();
-
-                    return new ApiLogEntry
-                    {
-                        Application = "[Api]",
-                        User = context.User.Identity.Name,
-                        Machine = Environment.MachineName,
-                        RequestContentType = context.Request.ContentType,
-                        RequestRouteTemplate = routeData.Route.RouteTemplate,
-                        RequestRouteData = "",
-                        RequestIpAddress = context.Request.UserHostAddress,
-                        RequestMethod = request.Method.Method,
-                        RequestHeaders = WebApiHelper.SerializeHeaders(request.Headers),
-                        RequestTimestamp = DateTime.Now,
-                        RequestUri = request.RequestUri.ToString()
-                    };
-                }
-                catch (Exception ex)
-                {
-                    //  logger.Debug(" " + ex.ToString());
-                    return null;
-                }
-
-            }
-
-            private ApiLogEntry CreateApiLogEntryWithRequestData_Temp(HttpRequestMessage request)
-            {
-                try
-                {
-                    HttpContext context = ((HttpContext)request["MS_HttpContext"]);
-                    var routeData = request.GetRouteData();
-
-                    return new ApiLogEntry
-                    {
-                        Application = "[Api]",
-                        User = context.User.Identity.Name,
-                        Machine = Environment.MachineName,
-                        RequestContentType = context.Request.ContentType,
-                        RequestRouteTemplate = routeData.Route.RouteTemplate,
-                        RequestIpAddress = context.Request.UserHostAddress,
-                        RequestMethod = request.Method.Method,
-                        RequestHeaders = WebApiHelper.SerializeHeaders(request.Headers),
-                        RequestTimestamp = DateTime.Now,
-                        RequestUri = request.RequestUri.ToString()
-                    };
-                }
-                catch (Exception ex)
-                {
-                    // logger.Debug("11111 " + ex.ToString());
-                    return null;
-                }
-
-            }
-
-            private void WriteLog(ApiLogEntry log)
-            {
-                try
-                {
-
-                    if (log == null) return;
-                    using (var conn = new SqlConnection(apiLogConnectionString))
-                    {
-                        conn.Open();
-
-                        using (var cmd = new SqlCommand("[dbo].[uspInsertApiLog]", conn))
-                        {
-
-                            cmd.CommandType = System.Data.CommandType.StoredProcedure;
-                            cmd.Parameters.Add(new SqlParameter("Application", log.Application));
-                            cmd.Parameters.Add(new SqlParameter("User", log.User));
-                            cmd.Parameters.Add(new SqlParameter("Machine", log.Machine));
-                            cmd.Parameters.Add(new SqlParameter("RequestIpAddress", log.RequestIpAddress));
-                            cmd.Parameters.Add(new SqlParameter("RequestContentType", log.RequestContentType));
-                            cmd.Parameters.Add(new SqlParameter("RequestUri", log.RequestUri));
-                            cmd.Parameters.Add(new SqlParameter("RequestMethod", log.RequestMethod));
-                            cmd.Parameters.Add(new SqlParameter("RequestRouteTemplate", log.RequestRouteTemplate));
-                            cmd.Parameters.Add(new SqlParameter("RequestRouteData", ""));//log.RequestRouteData
-                            cmd.Parameters.Add(new SqlParameter("RequestHeaders", log.RequestHeaders));
-                            cmd.Parameters.Add(new SqlParameter("RequestTimestamp", log.RequestTimestamp));
-
-                            cmd.Parameters.Add(new SqlParameter("ResponseContentType", log.ResponseContentType));
-                            cmd.Parameters.Add(new SqlParameter("ResponseStatusCode", log.ResponseStatusCode));
-                            cmd.Parameters.Add(new SqlParameter("ResponseHeaders", log.ResponseHeaders));
-                            cmd.Parameters.Add(new SqlParameter("ResponseTimestamp", log.ResponseTimestamp));
-
-                            cmd.Parameters.Add(new SqlParameter("IsOutData", log.IsOutData));
-                            cmd.Parameters.Add(new SqlParameter("ErrorMsg", log.ErrorMsg));
-                            cmd.Parameters.Add(new SqlParameter("ErrorOn", log.ErrorOn));
-                            cmd.Parameters.Add(new SqlParameter("RequestContentBody", log.RequestContentBody));
-                            cmd.Parameters.Add(new SqlParameter("ResponseContentBody", log.ResponseContentBody));
-
-                            cmd.ExecuteNonQuery();
-                        }
-                    }
-
-
-                }
-                catch (Exception ex)
-                {
-                    Console.WriteLine(ex.ToString());
-                }
-
-
-            }
-        }
-    }
+    //                }, cancellationToken);
+    //        }
+
+    //        private ApiLogEntry CreateApiLogEntryWithRequestData(HttpRequestMessage request)
+    //        {
+    //            try
+    //            {
+    //                HttpContext context = (HttpContext)(request["MS_HttpContext"]);
+    //                var routeData = request.GetRouteData();
+
+    //                return new ApiLogEntry
+    //                {
+    //                    Application = "[Api]",
+    //                    User = context.User.Identity.Name,
+    //                    Machine = Environment.MachineName,
+    //                    RequestContentType = context.Request.ContentType,
+    //                    RequestRouteTemplate = routeData.Route.RouteTemplate,
+    //                    RequestRouteData = "",
+    //                    RequestIpAddress = context.Request.UserHostAddress,
+    //                    RequestMethod = request.Method.Method,
+    //                    RequestHeaders = WebApiHelper.SerializeHeaders(request.Headers),
+    //                    RequestTimestamp = DateTime.Now,
+    //                    RequestUri = request.RequestUri.ToString()
+    //                };
+    //            }
+    //            catch (Exception ex)
+    //            {
+    //                //  logger.Debug(" " + ex.ToString());
+    //                return null;
+    //            }
+
+    //        }
+
+    //        private ApiLogEntry CreateApiLogEntryWithRequestData_Temp(HttpRequestMessage request)
+    //        {
+    //            try
+    //            {
+    //                HttpContext context = ((HttpContext)request["MS_HttpContext"]);
+    //                var routeData = request.GetRouteData();
+
+    //                return new ApiLogEntry
+    //                {
+    //                    Application = "[Api]",
+    //                    User = context.User.Identity.Name,
+    //                    Machine = Environment.MachineName,
+    //                    RequestContentType = context.Request.ContentType,
+    //                    RequestRouteTemplate = routeData.Route.RouteTemplate,
+    //                    RequestIpAddress = context.Request.UserHostAddress,
+    //                    RequestMethod = request.Method.Method,
+    //                    RequestHeaders = WebApiHelper.SerializeHeaders(request.Headers),
+    //                    RequestTimestamp = DateTime.Now,
+    //                    RequestUri = request.RequestUri.ToString()
+    //                };
+    //            }
+    //            catch (Exception ex)
+    //            {
+    //                // logger.Debug("11111 " + ex.ToString());
+    //                return null;
+    //            }
+
+    //        }
+
+    //        private void WriteLog(ApiLogEntry log)
+    //        {
+    //            try
+    //            {
+
+    //                if (log == null) return;
+    //                using (var conn = new SqlConnection(apiLogConnectionString))
+    //                {
+    //                    conn.Open();
+
+    //                    using (var cmd = new SqlCommand("[dbo].[uspInsertApiLog]", conn))
+    //                    {
+
+    //                        cmd.CommandType = System.Data.CommandType.StoredProcedure;
+    //                        cmd.Parameters.Add(new SqlParameter("Application", log.Application));
+    //                        cmd.Parameters.Add(new SqlParameter("User", log.User));
+    //                        cmd.Parameters.Add(new SqlParameter("Machine", log.Machine));
+    //                        cmd.Parameters.Add(new SqlParameter("RequestIpAddress", log.RequestIpAddress));
+    //                        cmd.Parameters.Add(new SqlParameter("RequestContentType", log.RequestContentType));
+    //                        cmd.Parameters.Add(new SqlParameter("RequestUri", log.RequestUri));
+    //                        cmd.Parameters.Add(new SqlParameter("RequestMethod", log.RequestMethod));
+    //                        cmd.Parameters.Add(new SqlParameter("RequestRouteTemplate", log.RequestRouteTemplate));
+    //                        cmd.Parameters.Add(new SqlParameter("RequestRouteData", ""));//log.RequestRouteData
+    //                        cmd.Parameters.Add(new SqlParameter("RequestHeaders", log.RequestHeaders));
+    //                        cmd.Parameters.Add(new SqlParameter("RequestTimestamp", log.RequestTimestamp));
+
+    //                        cmd.Parameters.Add(new SqlParameter("ResponseContentType", log.ResponseContentType));
+    //                        cmd.Parameters.Add(new SqlParameter("ResponseStatusCode", log.ResponseStatusCode));
+    //                        cmd.Parameters.Add(new SqlParameter("ResponseHeaders", log.ResponseHeaders));
+    //                        cmd.Parameters.Add(new SqlParameter("ResponseTimestamp", log.ResponseTimestamp));
+
+    //                        cmd.Parameters.Add(new SqlParameter("IsOutData", log.IsOutData));
+    //                        cmd.Parameters.Add(new SqlParameter("ErrorMsg", log.ErrorMsg));
+    //                        cmd.Parameters.Add(new SqlParameter("ErrorOn", log.ErrorOn));
+    //                        cmd.Parameters.Add(new SqlParameter("RequestContentBody", log.RequestContentBody));
+    //                        cmd.Parameters.Add(new SqlParameter("ResponseContentBody", log.ResponseContentBody));
+
+    //                        cmd.ExecuteNonQuery();
+    //                    }
+    //                }
+
+
+    //            }
+    //            catch (Exception ex)
+    //            {
+    //                Console.WriteLine(ex.ToString());
+    //            }
+
+
+    //        }
+    //    }
+    //}
 }

+ 11 - 3
EVCB_OCPP.WEBAPI/Handlers/CPOAuthentication.cs

@@ -15,11 +15,19 @@ using Microsoft.AspNetCore.Mvc.Filters;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Http.Extensions;
 using System.IO;
+using Microsoft.Extensions.DependencyInjection;
 
 namespace EVCB_OCPP.WEBAPI.Handlers
 {
     public class CPOAuthentication : Attribute, IAuthorizationFilter
     {
+        private readonly IServiceProvider serviceProvider;
+
+        public CPOAuthentication(IServiceProvider serviceProvider)
+        {
+            this.serviceProvider = serviceProvider;
+        }
+
         public void OnAuthorization(AuthorizationFilterContext context)
         {
             HttpContext actionContext = context.HttpContext;
@@ -40,7 +48,7 @@ namespace EVCB_OCPP.WEBAPI.Handlers
                     else
                     {
                         string partnerId = actionContext.Request.Headers[EVCBConfiguration.Header_PartnerId].FirstOrDefault();
-                        string key = new CustomerService().GetAPIKey(new Guid(partnerId));
+                        string key = serviceProvider.GetRequiredService<ICustomerService>().GetAPIKey(new Guid(partnerId));
 
                         if (IsPass(actionContext, key))
                         {
@@ -99,7 +107,7 @@ namespace EVCB_OCPP.WEBAPI.Handlers
                     else
                     {
                         string partnerId = actionContext.Request.Headers[EVCBConfiguration.Header_PartnerId].FirstOrDefault();
-                        string key = new CustomerService().GetAPIKey(new Guid(partnerId));
+                        string key = serviceProvider.GetRequiredService<ICustomerService>().GetAPIKey(new Guid(partnerId));
 
                         if (IsPass(actionContext, key))
                         {
@@ -151,7 +159,7 @@ namespace EVCB_OCPP.WEBAPI.Handlers
 
             //Task<string> content = actionContext.Request.Body.Content.ReadAsStringAsync();
             //string body = content.Result;
-            string body = new StreamReader(actionContext.Request.Body).ReadToEnd();
+            string body = new StreamReader(actionContext.Request.Body).ReadToEndAsync().Result;//.ReadToEnd();
             string diplayUrl = actionContext.Request.GetDisplayUrl();
             string tempText = diplayUrl.Substring(diplayUrl.IndexOf('?') + 1).ToLower();
             tempText = tempText.StartsWith("http") ? string.Empty : tempText;

+ 22 - 34
EVCB_OCPP.WEBAPI/Handlers/GlobalExceptionHandler .cs

@@ -11,48 +11,36 @@ using System.Threading.Tasks;
 
 namespace EVCB_OCPP.WEBAPI.Handlers
 {
-    public class GlobalExceptionHandler: ExceptionHandler
-    {
+    //public class GlobalExceptionHandler: ExceptionHandler
+    //{
         
 
-        public override void Handle(ExceptionHandlerContext context)
-        {
+    //    public override void Handle(ExceptionHandlerContext context)
+    //    {
            
-            if (ShouldHandle(context))
-            {
+    //        if (ShouldHandle(context))
+    //        {
             
-                context.Result = new TextPlainErrorResult() { Request = context.Request  };
-            }
-        }
+    //            context.Result = new TextPlainErrorResult() { Request = context.Request  };
+    //        }
+    //    }
 
 
-        private class TextPlainErrorResult : IActionResult
-        {
-            public HttpRequestMessage Request { get; set; }
+    //    private class TextPlainErrorResult : IActionResult
+    //    {
+    //        public HttpRequestMessage Request { get; set; }
 
-      
+    //        public Task ExecuteResultAsync(ActionContext context)
+    //        {
+    //            var result = new CPOOuterResponse() { StatusMessage = CPO_StatusMessage.ERROR_MSG_Global_UNEXPECTEDERROR, StatusCode = (int)CPO_StatusCode.UnexpectedError };
 
-            //public Task<HttpResponseMessage> ExecuteAsync(CancellationToken cancellationToken)
-            //{
-            //    var result = new CPOOuterResponse() {  StatusMessage = CPO_StatusMessage.ERROR_MSG_Global_UNEXPECTEDERROR, StatusCode = (int)CPO_StatusCode.UnexpectedError };
+    //            var resultString = JsonConvert.SerializeObject(result, EVCBConfiguration.JSONSERIALIZER_FORMAT);
+    //            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.InternalServerError, result);
+    //            response.RequestMessage = Request;
+    //            return Task.FromResult(response);
+    //        }
+    //    }
 
-            //    var resultString = JsonConvert.SerializeObject(result,EVCBConfiguration.JSONSERIALIZER_FORMAT);
-            //    HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.InternalServerError, result);                                
-            //    response.RequestMessage = Request;
-            //    return Task.FromResult(response);
-            //}
 
-            public Task ExecuteResultAsync(ActionContext context)
-            {
-                var result = new CPOOuterResponse() { StatusMessage = CPO_StatusMessage.ERROR_MSG_Global_UNEXPECTEDERROR, StatusCode = (int)CPO_StatusCode.UnexpectedError };
-
-                var resultString = JsonConvert.SerializeObject(result, EVCBConfiguration.JSONSERIALIZER_FORMAT);
-                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.InternalServerError, result);
-                response.RequestMessage = Request;
-                return Task.FromResult(response);
-            }
-        }
-
-
-    }
+    //}
 }

+ 71 - 3
EVCB_OCPP.WEBAPI/Handlers/InernalAuthentication.cs

@@ -15,14 +15,82 @@ using Microsoft.AspNetCore.Mvc.Filters;
 using Microsoft.AspNetCore.Http;
 using System.IO;
 using Microsoft.AspNetCore.Http.Extensions;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.AspNetCore.Mvc;
 
 namespace EVCB_OCPP.WEBAPI.Handlers
 {
     public class InernalAuthentication : Attribute, IAuthorizationFilter
     {
+        private readonly IServiceProvider serviceProvider;
+
+        public InernalAuthentication(IServiceProvider serviceProvider)
+        {
+            this.serviceProvider = serviceProvider;
+        }
+
         public void OnAuthorization(AuthorizationFilterContext context)
         {
-            throw new NotImplementedException();
+            HttpContext actionContext = context.HttpContext;
+            int _status = StatusCodes.Status401Unauthorized;// HttpStatusCode.Unauthorized;
+            ErrorResponse _errorResponse = new ErrorResponse() { Code = 2001, Message = EVCBConfiguration.ERROR_MSG_INVALIDHEADER, ErrorDetail = string.Empty };
+
+            try
+            {
+                string formatMsg = "";
+                if (CheckHeaders(actionContext, out formatMsg))
+                {
+                    string timestamp = actionContext.Request.Headers[EVCBConfiguration.Header_Timestamp].FirstOrDefault();
+
+                    if (IsExpiryTime(timestamp))
+                    {
+                        _errorResponse.Code = 2002;
+                        _errorResponse.Message = EVCBConfiguration.ERROR_MSG_INVALIDTIMESTAMP;
+                    }
+                    else
+                    {
+                        string partnerId = actionContext.Request.Headers[EVCBConfiguration.Header_PartnerId].FirstOrDefault();
+                        string key = serviceProvider.GetRequiredService<ICustomerService>().GetAPIKey(new Guid(partnerId));
+
+                        if (IsPass(actionContext, key))
+                        {
+                            return;
+                            //return continuation().ContinueWith<HttpResponseMessage>((tsk) =>
+                            //{
+                            //    HttpResponseMessage response = tsk.Result;
+
+                            //    return response;
+
+                            //}, cancellationToken);
+                        }
+                        else
+                        {
+                            _errorResponse.Code = 2003;
+                            _errorResponse.Message = EVCBConfiguration.ERROR_MSG_INVALIDSIGNATURE;
+                        }
+                    }
+
+                }
+                else
+                {
+                    _errorResponse.Message = formatMsg;
+                }
+
+            }
+            catch (Exception ex)
+            {
+                _errorResponse.Code = 2000;
+                _errorResponse.Message = string.Format(EVCBConfiguration.ERRORMESSAGE_FORMAT, EVCBConfiguration.ERROR_MSG_UNEXPECTEDERROR, "InernalAuthentication", ex.ToString());
+            }
+
+
+            //return FromResult(new HttpResponseMessage(_status) { Content = new StringContent(JsonConvert.SerializeObject(_errorResponse), System.Text.Encoding.UTF8, "application/json") });
+            context.Result = new ContentResult()
+            {
+                StatusCode = _status,
+                ContentType = "application/json",
+                Content = JsonConvert.SerializeObject(_errorResponse)
+            };
         }
 
         public Task<HttpResponseMessage> ExecuteAuthorizationFilterAsync(HttpContext actionContext, CancellationToken cancellationToken, Func<Task<HttpResponseMessage>> continuation)
@@ -45,7 +113,7 @@ namespace EVCB_OCPP.WEBAPI.Handlers
                     else
                     {
                         string partnerId = actionContext.Request.Headers[EVCBConfiguration.Header_PartnerId].FirstOrDefault();
-                        string key = new CustomerService().GetAPIKey(new Guid(partnerId));
+                        string key = serviceProvider.GetRequiredService<ICustomerService>().GetAPIKey(new Guid(partnerId));
 
                         if (IsPass(actionContext, key))
                         {
@@ -100,7 +168,7 @@ namespace EVCB_OCPP.WEBAPI.Handlers
 
             //Task<string> content = actionContext.Request.Content.ReadAsStringAsync();
             //string body = content.Result;
-            string body = new StreamReader(actionContext.Request.Body).ReadToEnd();
+            string body = new StreamReader(actionContext.Request.Body).ReadToEndAsync().Result;//.ReadToEnd();
             string diplayUrl = actionContext.Request.GetDisplayUrl();
             string tempText = diplayUrl.Substring(diplayUrl.IndexOf('?') + 1).ToLower();
             tempText = tempText.StartsWith("http") ? string.Empty : tempText;

+ 18 - 19
EVCB_OCPP.WEBAPI/Helpers/WebApiHelper.cs

@@ -1,4 +1,5 @@
-using Newtonsoft.Json;
+using Microsoft.AspNetCore.Http;
+using Newtonsoft.Json;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -8,31 +9,29 @@ namespace EVCB_OCPP.WEBAPI.Helpers
 {
     public class WebApiHelper
     {
-        public static string SerializeRouteData(IHttpRouteData routeData)
-        {
-            return JsonConvert.SerializeObject(routeData, Formatting.Indented, new JsonSerializerSettings()
-            {
-                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
-            });
-        }
-        public static string SerializeHeaders(HttpHeaders headers)
+        //public static string SerializeRouteData(IHttpRouteData routeData)
+        //{
+        //    return JsonConvert.SerializeObject(routeData, Formatting.Indented, new JsonSerializerSettings()
+        //    {
+        //        ReferenceLoopHandling = ReferenceLoopHandling.Ignore
+        //    });
+        //}
+
+        public static string SerializeHeaders(IHeaderDictionary headers)
         {
             var dict = new Dictionary<string, string>();
 
             foreach (var item in headers.ToList())
             {
-                if (item.Value != null)
+                var header = String.Empty;
+                foreach (var value in item.Value)
                 {
-                    var header = String.Empty;
-                    foreach (var value in item.Value)
-                    {
-                        header += value + " ";
-                    }
-
-                    // Trim the trailing space and add item to the dictionary
-                    header = header.TrimEnd(" ".ToCharArray());
-                    dict.Add(item.Key, header);
+                    header += value + " ";
                 }
+
+                // Trim the trailing space and add item to the dictionary
+                header = header.TrimEnd(" ".ToCharArray());
+                dict.Add(item.Key, header);
             }
 
             return JsonConvert.SerializeObject(dict);

+ 197 - 0
EVCB_OCPP.WEBAPI/Middleware/APILogMiddleware.cs

@@ -0,0 +1,197 @@
+using EVCB_OCPP.WEBAPI.Helpers;
+using EVCB_OCPP.WEBAPI.Models;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Http.Extensions;
+using System.Net.Http;
+using System;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using System.IO;
+using System.Threading;
+using EVCB_OCPP.WEBAPI.Models.WebAPI;
+using Newtonsoft.Json;
+using System.Linq;
+using System.Net;
+using System.Data.SqlClient;
+using Microsoft.Extensions.Configuration;
+
+namespace EVCB_OCPP.WEBAPI.Middleware;
+
+public class APILogMiddleware
+{
+    private readonly RequestDelegate _next;
+    private readonly string apiLogConnectionString;
+
+    public APILogMiddleware(RequestDelegate next, IConfiguration configuration)
+    {
+        _next = next;
+        apiLogConnectionString = configuration.GetConnectionString("APILogDBContext");
+    }
+
+    public async Task Invoke(HttpContext context)
+    {
+        var request = context.Request;
+        string uri = request.GetDisplayUrl().ToString();
+        CancellationToken cancellationToken = context?.RequestAborted ?? CancellationToken.None;
+
+        var apiLogEntry = CreateApiLogEntryWithRequestData(request);
+
+        await new StreamReader(context.Request.Body).ReadToEndAsync()
+            .ContinueWith(task =>
+            {
+                apiLogEntry.RequestContentBody = task.Result;
+
+            }, cancellationToken);
+
+        var originalBodyStream = context.Response.Body;
+        var fakeResponseBody = new MemoryStream();
+        context.Response.Body = fakeResponseBody;
+
+        var task =  _next(context);
+        await task;
+
+        if (request.GetDisplayUrl().Contains("api/v1/file"))
+        {
+            return;
+        }
+
+        if (task.IsFaulted)
+        {
+            var result = new CPOOuterResponse() { StatusCode = (int)CPO_StatusCode.UnexpectedError, StatusMessage = CPO_StatusMessage.ERROR_MSG_Global_UNEXPECTEDERROR };
+
+            apiLogEntry.ResponseContentBody = JsonConvert.SerializeObject(result, EVCBConfiguration.JSONSERIALIZER_FORMAT);
+            apiLogEntry.ResponseContentType = "";
+            apiLogEntry.ResponseHeaders = "";
+
+            apiLogEntry.ErrorOn = DateTime.Now;
+            apiLogEntry.ErrorMsg = task.Exception.ToString().Replace("'", " ");
+
+            apiLogEntry.ResponseStatusCode = (int)HttpStatusCode.InternalServerError;
+            apiLogEntry.ResponseTimestamp = DateTime.Now;
+            WriteLog(apiLogEntry);
+            //return request.CreateResponse(HttpStatusCode.InternalServerError, result);
+            await context.Response.WriteAsJsonAsync(result);
+            return;
+        }
+        else
+        {
+            //var response = task.Result;
+            var response = context.Response;
+
+            if (response.Body != null)
+            {
+                fakeResponseBody.Seek(0, SeekOrigin.Begin);
+                var bodyData = await new StreamReader(response.Body).ReadToEndAsync();
+
+                apiLogEntry.ResponseContentBody = bodyData;
+                apiLogEntry.ResponseContentType = response.Headers.ContentType;
+                apiLogEntry.ResponseHeaders = WebApiHelper.SerializeHeaders(response.Headers);
+            }
+
+            int errorMessageIndex = apiLogEntry.ResponseContentBody.IndexOf(",\"ErrorDetail\"");
+            string endTag = apiLogEntry.ResponseContentBody.Last().ToString();
+
+            if (errorMessageIndex > 0)
+            {
+                string errorMsg = apiLogEntry.ResponseContentBody.Substring(errorMessageIndex).Remove(0, 16);
+                apiLogEntry.ResponseContentBody = apiLogEntry.ResponseContentBody.Remove(errorMessageIndex).Remove(0, 1);
+                apiLogEntry.ErrorOn = DateTime.Now;
+                apiLogEntry.ErrorMsg = errorMsg.Remove(errorMsg.Count() - 2).Replace("'", " ");
+
+                //response = request.CreateResponse(response.StatusCode, JsonConvert.DeserializeObject("{" + apiLogEntry.ResponseContentBody + "}"));
+                await response.WriteAsync("{" + apiLogEntry.ResponseContentBody + "}");
+            }
+
+            apiLogEntry.ResponseStatusCode = (int)response.StatusCode;
+            apiLogEntry.ResponseTimestamp = DateTime.Now;
+            WriteLog(apiLogEntry);
+
+            fakeResponseBody.Seek(0, SeekOrigin.Begin);
+            await fakeResponseBody.CopyToAsync(originalBodyStream);
+            await fakeResponseBody.DisposeAsync();
+
+            return;
+        }
+    }
+
+    private ApiLogEntry CreateApiLogEntryWithRequestData(HttpRequest request)
+    {
+        try
+        {
+            HttpContext context = request.HttpContext;
+            //var routeData = request.GetRouteData();
+
+            return new ApiLogEntry
+            {
+                Application = "[Api]",
+                User = context.User.Identity.Name,
+                Machine = Environment.MachineName,
+                RequestContentType = context.Request.ContentType,
+                //RequestRouteTemplate = routeData.Route.RouteTemplate,
+                RequestRouteData = "",
+                RequestIpAddress = context.Connection.RemoteIpAddress is null ? "" : context.Connection.RemoteIpAddress.ToString(),
+                RequestMethod = request.Method,
+                RequestHeaders = WebApiHelper.SerializeHeaders(request.Headers),
+                RequestTimestamp = DateTime.Now,
+                RequestUri = request.GetDisplayUrl()
+            };
+        }
+        catch (Exception ex)
+        {
+            //  logger.Debug(" " + ex.ToString());
+            return null;
+        }
+
+    }
+
+    private void WriteLog(ApiLogEntry log)
+    {
+        try
+        {
+
+            if (log == null) return;
+            using (var conn = new SqlConnection(apiLogConnectionString))
+            {
+                conn.Open();
+
+                using (var cmd = new SqlCommand("[dbo].[uspInsertApiLog]", conn))
+                {
+
+                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
+                    cmd.Parameters.Add(new SqlParameter("Application", log.Application));
+                    cmd.Parameters.Add(new SqlParameter("User", log.User));
+                    cmd.Parameters.Add(new SqlParameter("Machine", log.Machine));
+                    cmd.Parameters.Add(new SqlParameter("RequestIpAddress", log.RequestIpAddress));
+                    cmd.Parameters.Add(new SqlParameter("RequestContentType", log.RequestContentType));
+                    cmd.Parameters.Add(new SqlParameter("RequestUri", log.RequestUri));
+                    cmd.Parameters.Add(new SqlParameter("RequestMethod", log.RequestMethod));
+                    cmd.Parameters.Add(new SqlParameter("RequestRouteTemplate", log.RequestRouteTemplate));
+                    cmd.Parameters.Add(new SqlParameter("RequestRouteData", ""));//log.RequestRouteData
+                    cmd.Parameters.Add(new SqlParameter("RequestHeaders", log.RequestHeaders));
+                    cmd.Parameters.Add(new SqlParameter("RequestTimestamp", log.RequestTimestamp));
+
+                    cmd.Parameters.Add(new SqlParameter("ResponseContentType", log.ResponseContentType));
+                    cmd.Parameters.Add(new SqlParameter("ResponseStatusCode", log.ResponseStatusCode));
+                    cmd.Parameters.Add(new SqlParameter("ResponseHeaders", log.ResponseHeaders));
+                    cmd.Parameters.Add(new SqlParameter("ResponseTimestamp", log.ResponseTimestamp));
+
+                    cmd.Parameters.Add(new SqlParameter("IsOutData", log.IsOutData));
+                    cmd.Parameters.Add(new SqlParameter("ErrorMsg", log.ErrorMsg));
+                    cmd.Parameters.Add(new SqlParameter("ErrorOn", log.ErrorOn));
+                    cmd.Parameters.Add(new SqlParameter("RequestContentBody", log.RequestContentBody));
+                    cmd.Parameters.Add(new SqlParameter("ResponseContentBody", log.ResponseContentBody));
+
+                    cmd.ExecuteNonQuery();
+                }
+            }
+
+
+        }
+        catch (Exception ex)
+        {
+            Console.WriteLine(ex.ToString());
+        }
+
+
+    }
+}

+ 39 - 0
EVCB_OCPP.WEBAPI/Middleware/ExceptionMiddleware.cs

@@ -0,0 +1,39 @@
+using EVCB_OCPP.WEBAPI.Models.WebAPI;
+using Microsoft.Ajax.Utilities;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
+using System;
+using System.Net.Http;
+using System.Net;
+using System.Threading.Tasks;
+
+namespace EVCB_OCPP.WEBAPI.Middleware;
+
+public class ExceptionMiddleware
+{
+    private readonly RequestDelegate _next;
+
+    public ExceptionMiddleware(RequestDelegate next)
+    {
+        _next = next;
+    }
+
+    public async Task Invoke(HttpContext context)
+    {
+        try
+        {
+            await _next(context);
+        }
+        catch (Exception ex)
+        {
+            var result = new CPOOuterResponse() {
+                StatusMessage = CPO_StatusMessage.ERROR_MSG_Global_UNEXPECTEDERROR, 
+                StatusCode = (int)CPO_StatusCode.UnexpectedError };
+
+            var resultString = JsonConvert.SerializeObject(result, EVCBConfiguration.JSONSERIALIZER_FORMAT);
+
+            await context.Response.WriteAsync(resultString);
+        }
+    }
+}

+ 1 - 1
EVCB_OCPP.WEBAPI/Properties/launchSettings.json

@@ -6,7 +6,7 @@
       "environmentVariables": {
         "ASPNETCORE_ENVIRONMENT": "Development"
       },
-      "applicationUrl": "https://localhost:3615;http://localhost:3616"
+      "applicationUrl": "https://localhost:13615;http://localhost:13616"
     }
   }
 }

+ 13 - 3
EVCB_OCPP.WEBAPI/Services/ChargePointService.cs

@@ -3,6 +3,8 @@ using EVCB_OCPP.Packet.Messages.SubTypes;
 using EVCB_OCPP.WEBAPI.Models;
 using EVCB_OCPP.WEBAPI.Models.WebAPI;
 using EVCB_OCPP.WEBAPI.Models.WebAPI.Dto;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
 using System;
 using System.Collections.Generic;
 using System.Configuration;
@@ -21,8 +23,16 @@ namespace EVCB_OCPP.WEBAPI.Services
 
     public class ChargePointService : IChargePointService
     {
-        string mainConnectionString = ConfigurationManager.ConnectionStrings["MainDBContext"].ConnectionString;
-        string meterConnectionString = ConfigurationManager.ConnectionStrings["MeterValueDBContext"].ConnectionString;
+        readonly string mainConnectionString;
+        readonly string meterConnectionString;
+        private readonly IServiceProvider serviceProvider;
+
+        public ChargePointService(IConfiguration configuration, IServiceProvider serviceProvider)
+        {
+            mainConnectionString = configuration.GetConnectionString("MainDBContext");
+            meterConnectionString = configuration.GetConnectionString("MeterValueDBContext");
+            this.serviceProvider = serviceProvider;
+        }
 
         public DateTime GetLastUpdatedTimebyMachineId(string machineId)
         {
@@ -88,7 +98,7 @@ namespace EVCB_OCPP.WEBAPI.Services
         public EVSE GetEVSEsbyChargeBoxId(string chargeboxid, DateTime? dateFrom, DateTime? dateTo)
         {
             string machineId = GetMachineIdbyChargeBoxId(chargeboxid);
-            ChargePointService _CPService = new ChargePointService();
+            ChargePointService _CPService = serviceProvider.GetRequiredService<ChargePointService>();//new ChargePointService();
 
             var _machineUpdateOn = _CPService.GetLastUpdatedTimebyMachineId(machineId);
 

+ 13 - 3
EVCB_OCPP.WEBAPI/Services/ChargingStationService.cs

@@ -1,6 +1,8 @@
 using Dapper;
 using EVCB_OCPP.WEBAPI.Models.WebAPI;
 using EVCB_OCPP.WEBAPI.Models.WebAPI.Dto;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
 using System;
 using System.Collections.Generic;
 using System.Configuration;
@@ -20,9 +22,17 @@ namespace EVCB_OCPP.WEBAPI.Services
     }
     public class ChargingStationService : IChargingStationService
     {
+        string mainConnectionString;
+        string webConnectionString;
+        private readonly IServiceProvider serviceProvider;
+
+        public ChargingStationService(IConfiguration configuration, IServiceProvider serviceProvider)
+        {
+            mainConnectionString = configuration.GetConnectionString("MainDBContext");
+            webConnectionString = configuration.GetConnectionString("WebDBContext");
+            this.serviceProvider = serviceProvider;
+        }
 
-        string mainConnectionString = ConfigurationManager.ConnectionStrings["MainDBContext"].ConnectionString;
-        string webConnectionString = ConfigurationManager.ConnectionStrings["WebDBContext"].ConnectionString;
         public List<Station> GetStationsbyCustomerId(string customerId)
         {
             List<Station> _stations = new List<Station>();
@@ -79,7 +89,7 @@ namespace EVCB_OCPP.WEBAPI.Services
                 string strSql = "Select MachineId from [dbo].[StationMachine] where StationId=@StationId; ";
                 machineIds = conn.Query<String>(strSql, parameters).ToList();
             }
-            ChargePointService _CPService = new ChargePointService();
+            ChargePointService _CPService = serviceProvider.GetRequiredService<ChargePointService>();// new ChargePointService();
             while (startIndex < limit && startIndex < machineIds.Count)
             {
                 var _machineUpdateOn = _CPService.GetLastUpdatedTimebyMachineId(machineIds[startIndex]);

+ 4 - 3
EVCB_OCPP.WEBAPI/Services/CustomerService.cs

@@ -1,4 +1,5 @@
 using Dapper;
+using Microsoft.Extensions.Configuration;
 using System;
 using System.Collections.Generic;
 using System.Configuration;
@@ -16,10 +17,10 @@ namespace EVCB_OCPP.WEBAPI.Services
 
     public class CustomerService : ICustomerService
     {
-        string mainConnectionString = ConfigurationManager.ConnectionStrings["MainDBContext"].ConnectionString;
-        public CustomerService()
+        readonly string mainConnectionString;
+        public CustomerService(IConfiguration configuration)
         {
-
+            mainConnectionString = configuration.GetConnectionString("MainDBContext");
         }
 
         public string GetAPIKey(Guid partnerId)

+ 14 - 3
EVCB_OCPP.WEBAPI/Services/Integration/ChargePoint16Service.cs

@@ -3,6 +3,9 @@ using EVCB_OCPP.Packet.Messages.SubTypes;
 using EVCB_OCPP.WEBAPI.Models;
 using EVCB_OCPP.WEBAPI.Models.WebAPI;
 using EVCB_OCPP.WEBAPI.Models.WebAPI.Dto;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
 using System;
 using System.Collections.Generic;
 using System.Configuration;
@@ -29,8 +32,16 @@ namespace EVCB_OCPP.WEBAPI.Services.Integration
 
     public class ChargePoint16Service : IChargePointService
     {
-        string mainConnectionString = ConfigurationManager.ConnectionStrings["MainDBContext"].ConnectionString;
-        string meterConnectionString = ConfigurationManager.ConnectionStrings["MeterValueDBContext"].ConnectionString;
+        readonly string mainConnectionString;
+        readonly string meterConnectionString;
+        private readonly IServiceProvider serviceProvider;
+
+        public ChargePoint16Service(IConfiguration configuration, IServiceProvider serviceProvider)
+        {
+            mainConnectionString = configuration.GetConnectionString("MainDBContext");
+            meterConnectionString = configuration.GetConnectionString("MeterValueDBContext");
+            this.serviceProvider = serviceProvider;
+        }
 
         public DateTime GetLastUpdatedTimebyMachineId(string machineId)
         {
@@ -114,7 +125,7 @@ namespace EVCB_OCPP.WEBAPI.Services.Integration
         public EVSE GetEVSEsbyChargeBoxId(string chargeboxid, DateTime? dateFrom, DateTime? dateTo)
         {
             string machineId = GetMachineIdbyChargeBoxId(chargeboxid);
-            ChargePoint16Service _CPService = new ChargePoint16Service();
+            ChargePoint16Service _CPService = serviceProvider.GetRequiredService<ChargePoint16Service>();
 
             var _machineUpdateOn = _CPService.GetLastUpdatedTimebyMachineId(machineId);
 

+ 10 - 2
EVCB_OCPP.WEBAPI/Services/Integration/ChargePoint201Service.cs

@@ -3,6 +3,7 @@ using EVCB_OCPP.Packet.Messages.SubTypes;
 using EVCB_OCPP.WEBAPI.Models;
 using EVCB_OCPP.WEBAPI.Models.WebAPI;
 using EVCB_OCPP.WEBAPI.Models.WebAPI.Dto;
+using Microsoft.Extensions.Configuration;
 using System;
 using System.Collections.Generic;
 using System.Configuration;
@@ -21,8 +22,15 @@ namespace EVCB_OCPP.WEBAPI.Services.Integration
     public class ChargePoint201Service : IChargePointService
     {
 
-        string mainConnectionString = ConfigurationManager.ConnectionStrings["Main20DBContext"].ConnectionString;
-        string meterConnectionString = ConfigurationManager.ConnectionStrings["MeterValue20DBContext"].ConnectionString;
+        readonly string mainConnectionString;
+        readonly string meterConnectionString;
+
+        public ChargePoint201Service(IConfiguration configuration)
+        {
+            mainConnectionString = configuration.GetConnectionString("Main20DBContext");
+            meterConnectionString = configuration.GetConnectionString("MeterValue20DBContext");
+        }
+
         public bool ContainsChargePoint(string chargeBoxId, string customerId)
         {
             bool existed = false;

+ 16 - 5
EVCB_OCPP.WEBAPI/Services/Integration/ChargingStationService.cs

@@ -1,6 +1,9 @@
 using Dapper;
 using EVCB_OCPP.WEBAPI.Models.WebAPI;
 using EVCB_OCPP.WEBAPI.Models.WebAPI.Dto;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
 using System;
 using System.Collections.Generic;
 using System.Configuration;
@@ -16,9 +19,17 @@ namespace EVCB_OCPP.WEBAPI.Services.Integration
     /// 因此沒有分 ocpp16....  機器
     /// </summary>
     public class ChargingStationService
-    {       //MainDBContext
-        string webConnectionString = ConfigurationManager.ConnectionStrings["WebDBContext"].ConnectionString;
-        string main16ConnectionString = ConfigurationManager.ConnectionStrings["MainDBContext"].ConnectionString;
+    {
+        private readonly IServiceProvider serviceProvider;
+        private readonly string webConnectionString;
+        private readonly  string main16ConnectionString;
+
+        public ChargingStationService(IConfiguration configuration, IServiceProvider serviceProvider)
+        {
+            this.serviceProvider = serviceProvider;
+            webConnectionString = configuration.GetConnectionString("WebDBContext");
+            main16ConnectionString = configuration.GetConnectionString("MainDBContext");
+        }
 
         public List<Station> GetStationsbyCustomerId(string customerId)
         {
@@ -79,8 +90,8 @@ namespace EVCB_OCPP.WEBAPI.Services.Integration
           
             while (startIndex < limit && startIndex < machineIds.Count)
             {
-                var machine_by201 = new ChargePoint201Service().GetBasicInfobyId(machineIds[startIndex]);
-                var machine_by16 = new ChargePoint16Service().GetBasicInfobyId(machineIds[startIndex]);
+                var machine_by201 = serviceProvider.GetRequiredService<ChargePoint201Service>().GetBasicInfobyId(machineIds[startIndex]);
+                var machine_by16 = serviceProvider.GetRequiredService<ChargePoint16Service>().GetBasicInfobyId(machineIds[startIndex]);
                 var machine201UpdateOn = machine_by201==null? EVCBConfiguration.DefaultTime:machine_by201.LastUpdated;
                 var machine16UpdateOn = machine_by16 == null ? EVCBConfiguration.DefaultTime : machine_by16.LastUpdated;
                 int connectiontype = machine201UpdateOn > machine16UpdateOn ? 2 : 1;

+ 5 - 3
EVCB_OCPP.WEBAPI/Services/Integration/ServerTriggerService.cs

@@ -11,6 +11,7 @@ using System.Data;
 using System.Data.SqlClient;
 using System.Linq;
 using System.Net;
+using Microsoft.Extensions.Configuration;
 
 namespace EVCB_OCPP.WEBAPI.Services.Integration
 {
@@ -89,12 +90,13 @@ namespace EVCB_OCPP.WEBAPI.Services.Integration
 
     public class ServerTriggerService : IServerTriggerService
     {
-
-        string mainConnectionString = ConfigurationManager.ConnectionStrings["MainDBContext"].ConnectionString;
-        public ServerTriggerService()
+        readonly string mainConnectionString;
+        public ServerTriggerService(IConfiguration configuration)
         {
             var dt = new DateTime(1991, 1, 1).AddHours(8).ToUniversalTime();
             long ticks = dt.Ticks;
+
+            mainConnectionString = configuration.GetConnectionString("MainDBContext");
         }
 
         public void AddMessage(string ChargeBoxId, string uuid, IRequest request)

+ 7 - 2
EVCB_OCPP.WEBAPI/Services/ServerTriggerService.cs

@@ -3,6 +3,7 @@ using EVCB_OCPP.Packet.Features;
 using EVCB_OCPP.Packet.Messages;
 using EVCB_OCPP.Packet.Messages.SubTypes;
 using EVCB_OCPP.WEBAPI.Models.WebAPI;
+using Microsoft.Extensions.Configuration;
 using Newtonsoft.Json;
 using System;
 using System.Collections.Generic;
@@ -89,10 +90,14 @@ namespace EVCB_OCPP.WEBAPI.Services
 
     public class ServerTriggerService : IServerTriggerService
     {
+        private readonly string mainConnectionString;
+        private readonly IConfiguration configuration;
 
-        string mainConnectionString = ConfigurationManager.ConnectionStrings["MainDBContext"].ConnectionString;
-        public ServerTriggerService()
+        public ServerTriggerService(IConfiguration configuration)
         {
+            this.configuration = configuration;
+            mainConnectionString = configuration.GetConnectionString("MainDBContext");
+
             var dt = new DateTime(1991, 1, 1).AddHours(8).ToUniversalTime();
             long ticks = dt.Ticks;
         }

+ 22 - 0
EVCB_OCPP.WEBAPI/Startup.cs

@@ -5,8 +5,13 @@
 
 using System;
 using System.Collections.Generic;
+using System.Configuration;
 using System.Linq;
 using System.Threading.Tasks;
+using EVCB_OCPP.WEBAPI.Handlers;
+using EVCB_OCPP.WEBAPI.Middleware;
+using EVCB_OCPP.WEBAPI.Services;
+using EVCB_OCPP.WEBAPI.Services.Integration;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Mvc;
@@ -36,9 +41,22 @@ namespace EVCB_OCPP.WEBAPI
                 // https://docs.microsoft.com/dotnet/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to
                 .AddNewtonsoftJson(options =>
                 {
+                    options.SerializerSettings.NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore;
+                    options.SerializerSettings.DateFormatString = Configuration["UTC_DATETIMEFORMAT"];
                     options.UseMemberCasing();
                 });
 
+            services.AddScoped<Services.ServerTriggerService>();
+            services.AddScoped<Services.ChargingStationService>();
+            services.AddScoped<Services.Integration.ServerTriggerService>();
+            services.AddScoped<Services.Integration.ChargingStationService>();
+            services.AddScoped<ICustomerService,CustomerService>();
+            services.AddScoped<ChargePointService>();
+            services.AddScoped<ChargePoint16Service>();
+            services.AddScoped<ChargePoint201Service>();
+
+            services.AddScoped<CPOAuthentication>();
+            services.AddScoped<InernalAuthentication>();
         }
 
         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
@@ -47,8 +65,12 @@ namespace EVCB_OCPP.WEBAPI
             if (env.IsDevelopment())
             {
                 app.UseDeveloperExceptionPage();
+                //app.UseSwagger();
             }
 
+            app.UseMiddleware<ExceptionMiddleware>();
+            //app.UseMiddleware<APILogMiddleware>();
+
             app.UseStaticFiles();
             app.UseRouting();
             app.UseAuthorization();

+ 0 - 24
EVCB_OCPP.WEBAPI/Views/Home/Index.cshtml

@@ -1,24 +0,0 @@
-<div class="jumbotron">
-    <h1>ASP.NET</h1>
-    <p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS, and JavaScript.</p>
-    <p><a href="https://asp.net" class="btn btn-primary btn-lg">Learn more &raquo;</a></p>
-</div>
-<div class="row">
-    <div class="col-md-4">
-        <h2>Getting started</h2>
-        <p>ASP.NET Web API is a framework that makes it easy to build HTTP services that reach
-        a broad range of clients, including browsers and mobile devices. ASP.NET Web API
-        is an ideal platform for building RESTful applications on the .NET Framework.</p>
-        <p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301870">Learn more &raquo;</a></p>
-    </div>
-    <div class="col-md-4">
-        <h2>Get more libraries</h2>
-        <p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p>
-        <p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301871">Learn more &raquo;</a></p>
-    </div>
-    <div class="col-md-4">
-        <h2>Web Hosting</h2>
-        <p>You can easily find a web hosting company that offers the right mix of features and price for your applications.</p>
-        <p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301872">Learn more &raquo;</a></p>
-    </div>
-</div>

+ 0 - 14
EVCB_OCPP.WEBAPI/Views/Shared/Error.cshtml

@@ -1,14 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-    <meta name="viewport" content="width=device-width" />
-    <title>錯誤</title>
-</head>
-<body>
-    <hgroup>
-        <h1>錯誤。</h1>
-        <h2>處理您的要求時發生錯誤。</h2>
-    </hgroup>
-</body>
-</html>

+ 0 - 43
EVCB_OCPP.WEBAPI/Views/Shared/_Layout.cshtml

@@ -1,43 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-    <meta charset="utf-8" />
-    <meta name="viewport" content="width=device-width" />
-    <title>@ViewBag.Title</title>
-    @Styles.Render("~/Content/css")
-    @Scripts.Render("~/bundles/modernizr")
-</head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<body>
-    <div class="navbar navbar-inverse navbar-fixed-top">
-        <div class="container">
-            <div class="navbar-header">
-                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
-                    <span class="icon-bar"></span>
-                    <span class="icon-bar"></span>
-                    <span class="icon-bar"></span>
-                </button>
-                @Html.ActionLink("應用程式名稱", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
-            </div>
-            <div class="navbar-collapse collapse">
-                <ul class="nav navbar-nav">
-                    <li>@Html.ActionLink("首頁", "Index", "Home", new { area = "" }, null)</li>
-                    <li>@Html.ActionLink("API", "Index", "Help", new { area = "" }, null)</li>
-                </ul>
-            </div>
-        </div>
-    </div>
-    <div class="container body-content">
-        @RenderBody()
-        <hr />
-        <footer>
-            <p>&copy; @DateTime.Now.Year - 我的 ASP.NET 應用程式</p>
-        </footer>
-    </div>
-
-    @Scripts.Render("~/bundles/jquery")
-    @Scripts.Render("~/bundles/bootstrap")
-    @RenderSection("scripts", required: false)
-</body>
-</html>

+ 0 - 43
EVCB_OCPP.WEBAPI/Views/Web.config

@@ -1,43 +0,0 @@
-<?xml version="1.0"?>
-
-<configuration>
-  <configSections>
-    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
-      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
-      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
-    </sectionGroup>
-  </configSections>
-
-  <system.web.webPages.razor>
-    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
-    <pages pageBaseType="System.Web.Mvc.WebViewPage">
-      <namespaces>
-        <add namespace="System.Web.Mvc" />
-        <add namespace="System.Web.Mvc.Ajax" />
-        <add namespace="System.Web.Mvc.Html" />
-        <add namespace="System.Web.Optimization"/>
-        <add namespace="System.Web.Routing" />
-        <add namespace="EVCB_OCPP.WEBAPI" />
-      </namespaces>
-    </pages>
-  </system.web.webPages.razor>
-
-  <appSettings>
-    <add key="webpages:Enabled" value="false" />
-  </appSettings>
-
-  <system.webServer>
-    <handlers>
-      <remove name="BlockViewHandler"/>
-      <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
-    </handlers>
-  </system.webServer>
-
-  <system.web>
-    <compilation>
-      <assemblies>
-        <add assembly="System.Web.Mvc, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
-      </assemblies>
-    </compilation>
-  </system.web>
-</configuration>

+ 0 - 3
EVCB_OCPP.WEBAPI/Views/_ViewImports.cshtml

@@ -1,3 +0,0 @@
-@using EVCB_OCPP.WEBAPI
-
-@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

+ 0 - 3
EVCB_OCPP.WEBAPI/Views/_ViewStart.cshtml

@@ -1,3 +0,0 @@
-@{
-    Layout = "~/Views/Shared/_Layout.cshtml";
-}

+ 64 - 0
EVCB_OCPP.WEBAPI/wwwroot/css/app.css

@@ -0,0 +1,64 @@
+@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
+
+html, body {
+    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
+}
+
+h1:focus {
+    outline: none;
+}
+
+a, .btn-link {
+    color: #0071c1;
+}
+
+.btn-primary {
+    color: #fff;
+    background-color: #1b6ec2;
+    border-color: #1861ac;
+}
+
+.content {
+    padding-top: 1.1rem;
+}
+
+.valid.modified:not([type=checkbox]) {
+    outline: 1px solid #26b050;
+}
+
+.invalid {
+    outline: 1px solid red;
+}
+
+.validation-message {
+    color: red;
+}
+
+#blazor-error-ui {
+    background: lightyellow;
+    bottom: 0;
+    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
+    display: none;
+    left: 0;
+    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
+    position: fixed;
+    width: 100%;
+    z-index: 1000;
+}
+
+    #blazor-error-ui .dismiss {
+        cursor: pointer;
+        position: absolute;
+        right: 0.75rem;
+        top: 0.5rem;
+    }
+
+.blazor-error-boundary {
+    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
+    padding: 1rem 1rem 1rem 3.7rem;
+    color: white;
+}
+
+    .blazor-error-boundary::after {
+        content: "An error has occurred."
+    }

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 5 - 0
EVCB_OCPP.WEBAPI/wwwroot/css/bootstrap/bootstrap.min.css


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
EVCB_OCPP.WEBAPI/wwwroot/css/bootstrap/bootstrap.min.css.map


+ 86 - 0
EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/FONT-LICENSE

@@ -0,0 +1,86 @@
+SIL OPEN FONT LICENSE Version 1.1
+
+Copyright (c) 2014 Waybury
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.

+ 21 - 0
EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/ICON-LICENSE

@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Waybury
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

+ 114 - 0
EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/README.md

@@ -0,0 +1,114 @@
+[Open Iconic v1.1.1](http://useiconic.com/open)
+===========
+
+### Open Iconic is the open source sibling of [Iconic](http://useiconic.com). It is a hyper-legible collection of 223 icons with a tiny footprint&mdash;ready to use with Bootstrap and Foundation. [View the collection](http://useiconic.com/open#icons)
+
+
+
+## What's in Open Iconic?
+
+* 223 icons designed to be legible down to 8 pixels
+* Super-light SVG files - 61.8 for the entire set 
+* SVG sprite&mdash;the modern replacement for icon fonts
+* Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats
+* Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats
+* PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px.
+
+
+## Getting Started
+
+#### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](http://useiconic.com/open#icons) and [Reference](http://useiconic.com/open#reference) sections.
+
+### General Usage
+
+#### Using Open Iconic's SVGs
+
+We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute).
+
+```
+<img src="/open-iconic/svg/icon-name.svg" alt="icon name">
+```
+
+#### Using Open Iconic's SVG Sprite
+
+Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack.
+
+Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `<svg>` *tag and a unique class name for each different icon in the* `<use>` *tag.*  
+
+```
+<svg class="icon">
+  <use xlink:href="open-iconic.svg#account-login" class="icon-account-login"></use>
+</svg>
+```
+
+Sizing icons only needs basic CSS. All the icons are in a square format, so just set the `<svg>` tag with equal width and height dimensions.
+
+```
+.icon {
+  width: 16px;
+  height: 16px;
+}
+```
+
+Coloring icons is even easier. All you need to do is set the `fill` rule on the `<use>` tag.
+
+```
+.icon-account-login {
+  fill: #f00;
+}
+```
+
+To learn more about SVG Sprites, read [Chris Coyier's guide](http://css-tricks.com/svg-sprites-use-better-icon-fonts/).
+
+#### Using Open Iconic's Icon Font...
+
+
+##### …with Bootstrap
+
+You can find our Bootstrap stylesheets in `font/css/open-iconic-bootstrap.{css, less, scss, styl}`
+
+
+```
+<link href="/open-iconic/font/css/open-iconic-bootstrap.css" rel="stylesheet">
+```
+
+
+```
+<span class="oi oi-icon-name" title="icon name" aria-hidden="true"></span>
+```
+
+##### …with Foundation
+
+You can find our Foundation stylesheets in `font/css/open-iconic-foundation.{css, less, scss, styl}`
+
+```
+<link href="/open-iconic/font/css/open-iconic-foundation.css" rel="stylesheet">
+```
+
+
+```
+<span class="fi-icon-name" title="icon name" aria-hidden="true"></span>
+```
+
+##### …on its own
+
+You can find our default stylesheets in `font/css/open-iconic.{css, less, scss, styl}`
+
+```
+<link href="/open-iconic/font/css/open-iconic.css" rel="stylesheet">
+```
+
+```
+<span class="oi" data-glyph="icon-name" title="icon name" aria-hidden="true"></span>
+```
+
+
+## License
+
+### Icons
+
+All code (including SVG markup) is under the [MIT License](http://opensource.org/licenses/MIT).
+
+### Fonts
+
+All fonts are under the [SIL Licensed](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web).

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css


BIN
EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/font/fonts/open-iconic.eot


BIN
EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/font/fonts/open-iconic.otf


+ 543 - 0
EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/font/fonts/open-iconic.svg

@@ -0,0 +1,543 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<!--
+2014-7-1: Created.
+-->
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata>
+Created by FontForge 20120731 at Tue Jul  1 20:39:22 2014
+ By P.J. Onori
+Created by P.J. Onori with FontForge 2.0 (http://fontforge.sf.net)
+</metadata>
+<defs>
+<font id="open-iconic" horiz-adv-x="800" >
+  <font-face 
+    font-family="Icons"
+    font-weight="400"
+    font-stretch="normal"
+    units-per-em="800"
+    panose-1="2 0 5 3 0 0 0 0 0 0"
+    ascent="800"
+    descent="0"
+    bbox="-0.5 -101 802 800.126"
+    underline-thickness="50"
+    underline-position="-100"
+    unicode-range="U+E000-E0DE"
+  />
+    <missing-glyph />
+    <glyph glyph-name="" unicode="&#xe000;" 
+d="M300 700h500v-700h-500v100h400v500h-400v100zM400 500l200 -150l-200 -150v100h-400v100h400v100z" />
+    <glyph glyph-name="1" unicode="&#xe001;" 
+d="M300 700h500v-700h-500v100h400v500h-400v100zM200 500v-100h400v-100h-400v-100l-200 150z" />
+    <glyph glyph-name="2" unicode="&#xe002;" 
+d="M350 700c193 0 350 -157 350 -350v-50h100l-200 -200l-200 200h100v50c0 138 -112 250 -250 250s-250 -112 -250 -250c0 193 157 350 350 350z" />
+    <glyph glyph-name="3" unicode="&#xe003;" 
+d="M450 700c193 0 350 -157 350 -350c0 138 -112 250 -250 250s-250 -112 -250 -250v-50h100l-200 -200l-200 200h100v50c0 193 157 350 350 350z" />
+    <glyph glyph-name="4" unicode="&#xe004;" 
+d="M0 700h800v-100h-800v100zM100 500h600v-100h-600v100zM0 300h800v-100h-800v100zM100 100h600v-100h-600v100z" />
+    <glyph glyph-name="5" unicode="&#xe005;" 
+d="M0 700h800v-100h-800v100zM0 500h600v-100h-600v100zM0 300h800v-100h-800v100zM0 100h600v-100h-600v100z" />
+    <glyph glyph-name="6" unicode="&#xe006;" 
+d="M0 700h800v-100h-800v100zM200 500h600v-100h-600v100zM0 300h800v-100h-800v100zM200 100h600v-100h-600v100z" />
+    <glyph glyph-name="7" unicode="&#xe007;" 
+d="M400 700c75 0 146 -23 206 -59l-75 -225l-322 234c57 31 122 50 191 50zM125 588l191 -138l-310 -222c-4 24 -6 47 -6 72c0 114 49 215 125 288zM688 575c69 -72 112 -168 112 -275c0 -35 -8 -68 -16 -100h-218zM216 253l112 -347c-128 23 -232 109 -287 222zM372 100
+h372c-64 -109 -177 -185 -310 -197z" />
+    <glyph glyph-name="8" unicode="&#xe008;" horiz-adv-x="600" 
+d="M200 800h100v-500h200l-247 -300l-253 300h200v500z" />
+    <glyph glyph-name="9" unicode="&#xe009;" 
+d="M400 800c221 0 400 -179 400 -400s-179 -400 -400 -400s-400 179 -400 400s179 400 400 400zM300 700v-300h-200l300 -300l300 300h-200v300h-200z" />
+    <glyph glyph-name="a" unicode="&#xe00a;" 
+d="M400 800c221 0 400 -179 400 -400s-179 -400 -400 -400s-400 179 -400 400s179 400 400 400zM400 700l-300 -300l300 -300v200h300v200h-300v200z" />
+    <glyph glyph-name="b" unicode="&#xe00b;" 
+d="M400 800c221 0 400 -179 400 -400s-179 -400 -400 -400s-400 179 -400 400s179 400 400 400zM400 700v-200h-300v-200h300v-200l300 300z" />
+    <glyph glyph-name="c" unicode="&#xe00c;" 
+d="M400 800c221 0 400 -179 400 -400s-179 -400 -400 -400s-400 179 -400 400s179 400 400 400zM400 700l-300 -300h200v-300h200v300h200z" />
+    <glyph glyph-name="d" unicode="&#xe00d;" 
+d="M300 600v-200h500v-100h-500v-200l-300 247z" />
+    <glyph glyph-name="e" unicode="&#xe00e;" 
+d="M500 600l300 -247l-300 -253v200h-500v100h500v200z" />
+    <glyph glyph-name="f" unicode="&#xe00f;" horiz-adv-x="600" 
+d="M200 800h200v-500h200l-297 -300l-303 300h200v500z" />
+    <glyph glyph-name="10" unicode="&#xe010;" 
+d="M300 700v-200h500v-200h-500v-200l-300 297z" />
+    <glyph glyph-name="11" unicode="&#xe011;" 
+d="M500 700l300 -297l-300 -303v200h-500v200h500v200z" />
+    <glyph glyph-name="12" unicode="&#xe012;" horiz-adv-x="600" 
+d="M297 800l303 -300h-200v-500h-200v500h-200z" />
+    <glyph glyph-name="13" unicode="&#xe013;" horiz-adv-x="600" 
+d="M247 800l253 -300h-200v-500h-100v500h-200z" />
+    <glyph glyph-name="14" unicode="&#xe014;" 
+d="M400 800h100v-800h-100v800zM200 700h100v-600h-100v600zM600 600h100v-400h-100v400zM0 500h100v-200h-100v200z" />
+    <glyph glyph-name="15" unicode="&#xe015;" 
+d="M116 600l72 -72c-54 -54 -88 -126 -88 -209s34 -159 88 -213l-72 -72c-72 72 -116 175 -116 285s44 209 116 281zM684 600c72 -72 116 -171 116 -281s-44 -213 -116 -285l-72 72c54 54 88 130 88 213s-34 155 -88 209zM259 460l69 -72c-18 -18 -28 -41 -28 -69
+s10 -54 28 -72l-69 -72c-36 36 -59 89 -59 144s23 105 59 141zM541 459c36 -36 59 -85 59 -140s-23 -108 -59 -144l-69 72c18 18 28 44 28 72s-10 51 -28 69z" />
+    <glyph glyph-name="16" unicode="&#xe016;" horiz-adv-x="400" 
+d="M200 800c110 0 200 -90 200 -200s-90 -200 -200 -200s-200 90 -200 200s90 200 200 200zM100 319c31 -11 65 -19 100 -19s68 8 100 19v-319l-100 100l-100 -100v319z" />
+    <glyph glyph-name="17" unicode="&#xe017;" 
+d="M400 800c220 0 400 -180 400 -400s-180 -400 -400 -400s-400 180 -400 400s180 400 400 400zM400 700c-166 0 -300 -134 -300 -300c0 -66 21 -126 56 -175l419 419c-49 35 -109 56 -175 56zM644 575l-419 -419c49 -35 109 -56 175 -56c166 0 300 134 300 300
+c0 66 -21 126 -56 175z" />
+    <glyph glyph-name="18" unicode="&#xe018;" 
+d="M0 700h100v-600h700v-100h-800v700zM500 700h200v-500h-200v500zM200 500h200v-300h-200v300z" />
+    <glyph glyph-name="19" unicode="&#xe019;" 
+d="M397 800c13 1 23 -4 34 -13c2 -2 214 -254 241 -287h128v-100h-100v-366c0 -18 -16 -34 -34 -34h-532c-18 0 -34 16 -34 34v366h-100v100h128l234 281c9 11 22 18 35 19zM400 672l-144 -172h288zM250 300c-28 0 -50 -22 -50 -50v-100c0 -28 22 -50 50 -50s50 22 50 50
+v100c0 28 -22 50 -50 50zM550 300c-28 0 -50 -22 -50 -50v-100c0 -28 22 -50 50 -50s50 22 50 50v100c0 28 -22 50 -50 50z" />
+    <glyph glyph-name="1a" unicode="&#xe01a;" 
+d="M9 700h682c6 0 9 -4 9 -10v-190h100v-200h-100v-191c0 -6 -3 -9 -9 -9h-682c-6 0 -9 3 -9 9v582c0 6 3 9 9 9zM100 600v-400h500v400h-500z" />
+    <glyph glyph-name="1b" unicode="&#xe01b;" 
+d="M9 700h682c6 0 9 -4 9 -10v-190h100v-200h-100v-191c0 -6 -3 -9 -9 -9h-682c-6 0 -9 3 -9 9v582c0 6 3 9 9 9z" />
+    <glyph glyph-name="1c" unicode="&#xe01c;" 
+d="M92 650c0 23 19 50 45 50h3h5h5h500c28 0 50 -22 50 -50s-22 -50 -50 -50h-50v-141c9 -17 120 -231 166 -309c16 -26 34 -61 34 -106c0 -39 -15 -77 -41 -103h-3c-26 -25 -62 -41 -100 -41h-512c-39 0 -77 15 -103 41s-41 64 -41 103c0 46 18 80 34 106
+c46 78 157 292 166 309v141h-50c-2 0 -6 -1 -8 -1c-28 0 -50 23 -50 51zM500 600h-200v-162l-6 -10s-63 -123 -119 -228h450c-56 105 -119 228 -119 228l-6 10v162z" />
+    <glyph glyph-name="1d" unicode="&#xe01d;" 
+d="M400 800c110 0 200 -90 200 -200c0 -104 52 -198 134 -266c41 -34 66 -82 66 -134h-800c0 52 25 100 66 134c82 68 134 162 134 266c0 110 90 200 200 200zM300 100h200c0 -55 -45 -100 -100 -100s-100 45 -100 100z" />
+    <glyph glyph-name="1e" unicode="&#xe01e;" horiz-adv-x="600" 
+d="M150 800h50l350 -250l-225 -147l225 -153l-350 -250h-50v250l-75 -75l-75 75l150 150l-150 150l75 75l75 -75v250zM250 650v-200l150 100zM250 350v-200l150 100z" />
+    <glyph glyph-name="1f" unicode="&#xe01f;" 
+d="M0 800h500c110 0 200 -90 200 -200c0 -47 -17 -91 -44 -125c85 -40 144 -125 144 -225c0 -138 -112 -250 -250 -250h-550v100c55 0 100 45 100 100v400c0 55 -45 100 -100 100v100zM300 700v-200h100c55 0 100 45 100 100s-45 100 -100 100h-100zM300 400v-300h150
+c83 0 150 67 150 150s-67 150 -150 150h-150z" />
+    <glyph glyph-name="20" unicode="&#xe020;" horiz-adv-x="600" 
+d="M300 800v-300h200l-300 -500v300h-200z" />
+    <glyph glyph-name="21" unicode="&#xe021;" 
+d="M100 800h300v-300l100 100l100 -100v300h50c28 0 50 -22 50 -50v-550h-550c-28 0 -50 -22 -50 -50s22 -50 50 -50h550v-100h-550c-83 0 -150 67 -150 150v550l3 19c8 39 39 70 78 78z" />
+    <glyph glyph-name="22" unicode="&#xe022;" horiz-adv-x="400" 
+d="M0 800h400v-800l-200 200l-200 -200v800z" />
+    <glyph glyph-name="23" unicode="&#xe023;" 
+d="M0 800h800v-100h-800v100zM0 600h300v-103h203v103h297v-591c0 -6 -3 -9 -9 -9h-782c-6 0 -9 3 -9 9v591z" />
+    <glyph glyph-name="24" unicode="&#xe024;" 
+d="M300 800h200c55 0 100 -45 100 -100v-100h191c6 0 9 -3 9 -9v-241c0 -28 -22 -50 -50 -50h-700c-28 0 -50 22 -50 50v241c0 6 3 9 9 9h191v100c0 55 45 100 100 100zM300 700v-100h200v100h-200zM0 209c16 -6 32 -9 50 -9h700c18 0 34 3 50 9v-200c0 -6 -3 -9 -9 -9h-782
+c-6 0 -9 3 -9 9v200z" />
+    <glyph glyph-name="25" unicode="&#xe025;" horiz-adv-x="600" 
+d="M300 800c58 0 110 -16 147 -53s53 -89 53 -147h-100c0 39 -11 61 -25 75s-36 25 -75 25c-35 0 -55 -10 -72 -31s-28 -55 -28 -94c0 -51 20 -107 28 -175h172v-100h-178c-14 -60 -49 -127 -113 -200h491v-100h-600v122l16 12c69 69 95 121 106 166h-122v100h125
+c-8 50 -25 106 -25 175c0 58 16 114 50 156c34 43 88 69 150 69z" />
+    <glyph glyph-name="26" unicode="&#xe026;" 
+d="M34 700h4h3h4h5h700c28 0 50 -22 50 -50v-700c0 -28 -22 -50 -50 -50h-700c-28 0 -50 22 -50 50v700v2c0 20 15 42 34 48zM150 600c-28 0 -50 -22 -50 -50s22 -50 50 -50s50 22 50 50s-22 50 -50 50zM350 600c-28 0 -50 -22 -50 -50s22 -50 50 -50h300c28 0 50 22 50 50
+s-22 50 -50 50h-300zM100 400v-400h600v400h-600z" />
+    <glyph glyph-name="27" unicode="&#xe027;" 
+d="M744 797l6 -3l44 -44c4 -4 3 -8 0 -12l-266 -375l-15 -13l-25 -12c-23 72 -78 127 -150 150l12 25l13 15l375 266zM266 400c74 0 134 -60 134 -134c0 -147 -119 -266 -266 -266c-48 0 -95 12 -134 34c80 46 134 133 134 232c0 74 58 134 132 134z" />
+    <glyph glyph-name="28" unicode="&#xe028;" 
+d="M9 451c0 23 19 50 46 50c8 0 19 -3 26 -7l131 -66l29 22c-79 81 -1 250 118 250s197 -167 119 -250l28 -22l131 66c6 4 12 7 21 7c28 0 50 -22 50 -50c0 -17 -12 -37 -27 -45l-115 -56c9 -16 19 -33 25 -50h68c28 0 50 -22 50 -50s-22 -50 -50 -50h-50
+c0 -23 -2 -45 -6 -66l78 -40c21 -5 37 -28 37 -49c0 -28 -22 -50 -50 -50c-10 0 -23 5 -31 11l-65 35c-24 -46 -62 -86 -103 -110c-35 19 -60 45 -60 72v135v4v5v6v5v5v87c0 28 -22 50 -50 50c-24 0 -45 -17 -50 -40c1 -3 1 -8 1 -11s0 -8 -1 -11v-82v-4v-5v-144
+c0 -28 -24 -53 -59 -72c-41 25 -79 64 -103 110l-66 -35c-8 -6 -21 -11 -31 -11c-28 0 -50 22 -50 50c0 21 16 44 37 49l78 40c-4 21 -6 43 -6 66h-50h-5c-28 0 -50 22 -50 50c0 26 22 50 50 50h5h69c6 17 16 34 25 50l-116 56c-16 7 -28 27 -28 45z" />
+    <glyph glyph-name="29" unicode="&#xe029;" 
+d="M600 700h91c6 0 9 -3 9 -9v-582c0 -6 -3 -9 -9 -9h-91v600zM210 503l290 147v-500l-250 125v-3c-15 0 -25 -8 -28 -22l75 -178c11 -25 0 -58 -25 -69s-58 0 -69 25l-103 272h-91c-6 0 -9 3 -9 9v182c0 6 3 9 9 9h182z" />
+    <glyph glyph-name="2a" unicode="&#xe02a;" 
+d="M9 800h682c6 0 9 -3 9 -9v-782c0 -6 -3 -9 -9 -9h-682c-6 0 -9 3 -9 9v782c0 6 3 9 9 9zM100 700v-200h500v200h-500zM100 400v-100h100v100h-100zM300 400v-100h100v100h-100zM500 400v-300h100v300h-100zM100 200v-100h100v100h-100zM300 200v-100h100v100h-100z" />
+    <glyph glyph-name="2b" unicode="&#xe02b;" 
+d="M0 800h700v-200h-700v200zM0 500h700v-491c0 -6 -3 -9 -9 -9h-682c-6 0 -9 3 -9 9v491zM100 400v-100h100v100h-100zM300 400v-100h100v100h-100zM500 400v-100h100v100h-100zM100 200v-100h100v100h-100zM300 200v-100h100v100h-100z" />
+    <glyph glyph-name="2c" unicode="&#xe02c;" 
+d="M409 800h182c6 0 10 -4 12 -9l94 -182c2 -5 6 -9 12 -9h82c6 0 9 -3 9 -9v-582c0 -6 -3 -9 -9 -9h-782c-6 0 -9 3 -9 9v441c0 83 67 150 150 150h141c6 0 10 4 12 9l94 182c2 5 6 9 12 9zM150 500c-28 0 -50 -22 -50 -50s22 -50 50 -50s50 22 50 50s-22 50 -50 50z
+M500 500c-110 0 -200 -90 -200 -200s90 -200 200 -200s200 90 200 200s-90 200 -200 200zM500 400c55 0 100 -45 100 -100s-45 -100 -100 -100s-100 45 -100 100s45 100 100 100z" />
+    <glyph glyph-name="2d" unicode="&#xe02d;" 
+d="M0 600h800l-400 -400z" />
+    <glyph glyph-name="2e" unicode="&#xe02e;" horiz-adv-x="400" 
+d="M400 800v-800l-400 400z" />
+    <glyph glyph-name="2f" unicode="&#xe02f;" horiz-adv-x="400" 
+d="M0 800l400 -400l-400 -400v800z" />
+    <glyph glyph-name="30" unicode="&#xe030;" 
+d="M400 600l400 -400h-800z" />
+    <glyph glyph-name="31" unicode="&#xe031;" 
+d="M0 550c0 23 20 50 46 50h3h5h4h200c17 0 37 -13 44 -28l38 -72h444c14 0 19 -12 15 -25l-81 -250c-4 -13 -21 -25 -35 -25h-350c-14 0 -30 12 -34 25c-27 83 -54 167 -81 250l-10 25h-150c-2 0 -5 -1 -7 -1c-28 0 -51 23 -51 51zM358 100c28 0 50 -22 50 -50
+s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM658 100c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50z" />
+    <glyph glyph-name="32" unicode="&#xe032;" 
+d="M0 700h500v-100h-300v-300h-100l-100 -100v500zM300 500h500v-500l-100 100h-400v400z" />
+    <glyph glyph-name="33" unicode="&#xe033;" 
+d="M641 700l143 -141l-493 -493c-71 76 -146 148 -219 222l-72 71l141 141c50 -51 101 -101 153 -150c116 117 234 231 347 350z" />
+    <glyph glyph-name="34" unicode="&#xe034;" 
+d="M150 600l250 -250l250 250l150 -150l-400 -400l-400 400z" />
+    <glyph glyph-name="35" unicode="&#xe035;" horiz-adv-x="600" 
+d="M400 800l150 -150l-250 -250l250 -250l-150 -150l-400 400z" />
+    <glyph glyph-name="36" unicode="&#xe036;" horiz-adv-x="600" 
+d="M150 800l400 -400l-400 -400l-150 150l250 250l-250 250z" />
+    <glyph glyph-name="37" unicode="&#xe037;" 
+d="M400 600l400 -400l-150 -150l-250 250l-250 -250l-150 150z" />
+    <glyph glyph-name="38" unicode="&#xe038;" 
+d="M400 800c221 0 400 -179 400 -400s-179 -400 -400 -400s-400 179 -400 400s179 400 400 400zM600 622l-250 -250l-100 100l-72 -72l172 -172l322 322z" />
+    <glyph glyph-name="39" unicode="&#xe039;" 
+d="M400 800c221 0 400 -179 400 -400s-179 -400 -400 -400s-400 179 -400 400s179 400 400 400zM250 622l-72 -72l150 -150l-150 -150l72 -72l150 150l150 -150l72 72l-150 150l150 150l-72 72l-150 -150z" />
+    <glyph glyph-name="3a" unicode="&#xe03a;" 
+d="M350 800c28 0 50 -22 50 -50v-50h75c14 0 25 -11 25 -25v-75h-300v75c0 14 11 25 25 25h75v50c0 28 22 50 50 50zM25 700h75v-200h500v200h75c14 0 25 -11 25 -25v-650c0 -14 -11 -25 -25 -25h-650c-14 0 -25 11 -25 25v650c0 14 11 25 25 25z" />
+    <glyph glyph-name="3b" unicode="&#xe03b;" 
+d="M400 800c220 0 400 -180 400 -400s-180 -400 -400 -400s-400 180 -400 400s180 400 400 400zM400 700c-166 0 -300 -134 -300 -300s134 -300 300 -300s300 134 300 300s-134 300 -300 300zM350 600h100v-181c23 -24 47 -47 72 -69l-72 -72c-27 30 -55 59 -84 88l-16 12
+v222z" />
+    <glyph glyph-name="3c" unicode="&#xe03c;" 
+d="M450 800c138 0 250 -112 250 -250v-50c58 -21 100 -85 100 -150c0 -18 -3 -34 -9 -50h-191v50c0 83 -67 150 -150 150s-150 -67 -150 -150v-50h-272c-17 30 -28 63 -28 100c0 110 90 200 200 200c23 114 129 200 250 200zM434 400h3h4c3 0 6 1 9 1c28 0 50 -22 50 -50v-1
+v-150h150l-200 -200l-200 200h150v150v2c0 20 15 42 34 48z" />
+    <glyph glyph-name="3d" unicode="&#xe03d;" 
+d="M450 800c138 0 250 -112 250 -250v-50c58 -21 100 -85 100 -150c0 -18 -3 -34 -9 -50h-141l-200 200l-200 -200h-222c-17 30 -28 63 -28 100c0 110 90 200 200 200c23 114 129 200 250 200zM450 350l250 -250h-200v-50c0 -28 -22 -50 -50 -50s-50 22 -50 50v50h-200z" />
+    <glyph glyph-name="3e" unicode="&#xe03e;" 
+d="M450 700c138 0 250 -112 250 -250v-50c58 -21 100 -85 100 -150c0 -83 -67 -150 -150 -150h-450c-110 0 -200 90 -200 200s90 200 200 200c23 114 129 200 250 200z" />
+    <glyph glyph-name="3f" unicode="&#xe03f;" 
+d="M250 800c82 0 154 -40 200 -100c-143 0 -270 -85 -325 -209c-36 -10 -70 -25 -100 -47c-16 33 -25 67 -25 106c0 138 112 250 250 250zM450 600c138 0 250 -112 250 -250v-50c58 -21 100 -85 100 -150c0 -83 -67 -150 -150 -150h-450c-110 0 -200 90 -200 200
+s90 200 200 200c23 114 129 200 250 200z" />
+    <glyph glyph-name="40" unicode="&#xe040;" 
+d="M500 700h100l-300 -600h-100zM100 600h100l-100 -200l100 -200h-100l-100 200zM600 600h100l100 -200l-100 -200h-100l100 200z" />
+    <glyph glyph-name="41" unicode="&#xe041;" 
+d="M350 800h100l50 -119l28 -12l119 50l72 -72l-50 -119l12 -28l119 -50v-100l-119 -50l-12 -28l50 -119l-72 -72l-119 50l-28 -12l-50 -119h-100l-50 119l-28 12l-119 -50l-72 72l50 119l-12 28l-119 50v100l119 50l12 28l-50 119l72 72l119 -50l28 12zM400 550
+c-83 0 -150 -67 -150 -150s67 -150 150 -150s150 67 150 150s-67 150 -150 150z" />
+    <glyph glyph-name="42" unicode="&#xe042;" 
+d="M0 800h800v-200h-800v200zM200 500h400l-200 -200zM0 100h800v-100h-800v100z" />
+    <glyph glyph-name="43" unicode="&#xe043;" 
+d="M0 800h100v-800h-100v800zM600 800h200v-800h-200v800zM500 600v-400l-200 200z" />
+    <glyph glyph-name="44" unicode="&#xe044;" 
+d="M0 800h200v-800h-200v800zM700 800h100v-800h-100v800zM300 600l200 -200l-200 -200v400z" />
+    <glyph glyph-name="45" unicode="&#xe045;" 
+d="M0 800h800v-100h-800v100zM400 500l200 -200h-400zM0 200h800v-200h-800v200z" />
+    <glyph glyph-name="46" unicode="&#xe046;" 
+d="M150 700c83 0 150 -67 150 -150v-50h100v50c0 83 67 150 150 150s150 -67 150 -150s-67 -150 -150 -150h-50v-100h50c83 0 150 -67 150 -150s-67 -150 -150 -150s-150 67 -150 150v50h-100v-50c0 -83 -67 -150 -150 -150s-150 67 -150 150s67 150 150 150h50v100h-50
+c-83 0 -150 67 -150 150s67 150 150 150zM150 600c-28 0 -50 -22 -50 -50s22 -50 50 -50h50v50c0 28 -22 50 -50 50zM550 600c-28 0 -50 -22 -50 -50v-50h50c28 0 50 22 50 50s-22 50 -50 50zM300 400v-100h100v100h-100zM150 200c-28 0 -50 -22 -50 -50s22 -50 50 -50
+s50 22 50 50v50h-50zM500 200v-50c0 -28 22 -50 50 -50s50 22 50 50s-22 50 -50 50h-50z" />
+    <glyph glyph-name="47" unicode="&#xe047;" 
+d="M0 791c0 5 4 9 9 9h782c6 0 9 -4 9 -10v-790l-200 200h-591c-6 0 -9 3 -9 9v582z" />
+    <glyph glyph-name="48" unicode="&#xe048;" 
+d="M400 800c220 0 400 -180 400 -400s-180 -400 -400 -400s-400 180 -400 400s180 400 400 400zM400 700c-166 0 -300 -134 -300 -300s134 -300 300 -300s300 134 300 300s-134 300 -300 300zM600 600l-100 -300l-300 -100l100 300zM400 450c-28 0 -50 -22 -50 -50
+s22 -50 50 -50s50 22 50 50s-22 50 -50 50z" />
+    <glyph glyph-name="49" unicode="&#xe049;" 
+d="M400 800c220 0 400 -180 400 -400s-180 -400 -400 -400s-400 180 -400 400s180 400 400 400zM400 700v-600c166 0 300 134 300 300s-134 300 -300 300z" />
+    <glyph glyph-name="4a" unicode="&#xe04a;" 
+d="M0 800h800v-100h-800v100zM0 600h500v-100h-500v100zM0 300h800v-100h-800v100zM0 100h600v-100h-600v100zM750 100c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50z" />
+    <glyph glyph-name="4b" unicode="&#xe04b;" 
+d="M25 700h750c14 0 25 -11 25 -25v-75h-800v75c0 14 11 25 25 25zM0 500h800v-375c0 -14 -11 -25 -25 -25h-750c-14 0 -25 11 -25 25v375zM100 300v-100h100v100h-100zM300 300v-100h100v100h-100z" />
+    <glyph glyph-name="4c" unicode="&#xe04c;" 
+d="M100 800h100v-100h450l100 100l50 -50l-100 -100v-450h100v-100h-100v-100h-100v100h-500v500h-100v100h100v100zM200 600v-350l350 350h-350zM600 550l-350 -350h350v350z" />
+    <glyph glyph-name="4d" unicode="&#xe04d;" 
+d="M400 800c220 0 400 -180 400 -400s-180 -400 -400 -400s-400 180 -400 400s180 400 400 400zM400 700c-166 0 -300 -134 -300 -300s134 -300 300 -300s300 134 300 300s-134 300 -300 300zM400 600c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50z
+M200 452c0 20 15 42 34 48h3h3h8c12 0 28 -7 36 -16l91 -90l25 6c55 0 100 -45 100 -100s-45 -100 -100 -100s-100 45 -100 100l6 25l-90 91c-9 8 -16 24 -16 36zM550 500c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50z" />
+    <glyph glyph-name="4e" unicode="&#xe04e;" 
+d="M300 800h200v-300h200l-300 -300l-300 300h200v300zM0 100h800v-100h-800v100z" />
+    <glyph glyph-name="4f" unicode="&#xe04f;" 
+d="M0 800h800v-100h-800v100zM400 600l300 -300h-200v-300h-200v300h-200z" />
+    <glyph glyph-name="50" unicode="&#xe050;" 
+d="M200 700h600v-600h-600l-200 300zM350 622l-72 -72l150 -150l-150 -150l72 -72l150 150l150 -150l72 72l-150 150l150 150l-72 72l-150 -150z" />
+    <glyph glyph-name="51" unicode="&#xe051;" 
+d="M400 700c220 0 400 -180 400 -400h-100c0 166 -134 300 -300 300s-300 -134 -300 -300h-100c0 220 180 400 400 400zM341 491l59 -88l59 88c81 -25 141 -101 141 -191c0 -110 -90 -200 -200 -200s-200 90 -200 200c0 90 60 166 141 191z" />
+    <glyph glyph-name="52" unicode="&#xe052;" 
+d="M0 800h300v-400h400v-400h-700v800zM400 800l300 -300h-300v300zM100 600v-100h100v100h-100zM100 400v-100h100v100h-100zM100 200v-100h400v100h-400z" />
+    <glyph glyph-name="53" unicode="&#xe053;" horiz-adv-x="600" 
+d="M200 700h100v-100h75c30 0 58 -6 81 -22s44 -44 44 -78v-100h-100v94c-4 3 -13 6 -25 6h-250c-14 0 -25 -11 -25 -25v-50c0 -15 20 -40 34 -44l257 -65c66 -16 109 -73 109 -141v-50c0 -68 -57 -125 -125 -125h-75v-100h-100v100h-75c-30 0 -58 6 -81 22s-44 44 -44 78
+v100h100v-94c4 -3 13 -6 25 -6h250c14 0 25 11 25 25v50c0 15 -20 40 -34 44l-257 65c-66 16 -109 73 -109 141v50c0 68 57 125 125 125h75v100z" />
+    <glyph glyph-name="54" unicode="&#xe054;" 
+d="M0 700h300v-300l-300 -300v600zM500 700h300v-300l-300 -300v600z" />
+    <glyph glyph-name="55" unicode="&#xe055;" 
+d="M300 700v-600h-300v300zM800 700v-600h-300v300z" />
+    <glyph glyph-name="56" unicode="&#xe056;" 
+d="M300 700v-100c-111 0 -200 -89 -200 -200h200v-300h-300v300c0 165 135 300 300 300zM800 700v-100c-111 0 -200 -89 -200 -200h200v-300h-300v300c0 165 135 300 300 300z" />
+    <glyph glyph-name="57" unicode="&#xe057;" 
+d="M0 700h300v-300c0 -165 -135 -300 -300 -300v100c111 0 200 89 200 200h-200v300zM500 700h300v-300c0 -165 -135 -300 -300 -300v100c111 0 200 89 200 200h-200v300z" />
+    <glyph glyph-name="58" unicode="&#xe058;" horiz-adv-x="600" 
+d="M300 800l34 -34c11 -11 266 -270 266 -488c0 -165 -135 -300 -300 -300s-300 135 -300 300c0 218 255 477 266 488zM150 328c-28 0 -50 -22 -50 -50c0 -110 90 -200 200 -200c28 0 50 22 50 50s-22 50 -50 50c-55 0 -100 45 -100 100c0 28 -22 50 -50 50z" />
+    <glyph glyph-name="59" unicode="&#xe059;" 
+d="M400 800l400 -500h-800zM0 200h800v-200h-800v200z" />
+    <glyph glyph-name="5a" unicode="&#xe05a;" horiz-adv-x="600" 
+d="M300 800l300 -300h-600zM0 300h600l-300 -300z" />
+    <glyph glyph-name="5b" unicode="&#xe05b;" 
+d="M0 500h200v-200h-200v200zM300 500h200v-200h-200v200zM600 500h200v-200h-200v200z" />
+    <glyph glyph-name="5c" unicode="&#xe05c;" 
+d="M0 700h800v-100l-400 -200l-400 200v100zM0 500l400 -200l400 200v-400h-800v400z" />
+    <glyph glyph-name="5d" unicode="&#xe05d;" 
+d="M400 800l400 -200v-600h-800v600zM400 688l-300 -150v-188l300 -150l300 150v188zM200 500h400v-100l-200 -100l-200 100v100z" />
+    <glyph glyph-name="5e" unicode="&#xe05e;" 
+d="M600 700c69 0 134 -19 191 -50l-16 -106c-49 35 -109 56 -175 56c-131 0 -240 -84 -281 -200h331l-16 -100h-334c0 -36 8 -68 19 -100h297l-16 -100h-222c55 -61 133 -100 222 -100c78 0 147 30 200 78v-122c-59 -35 -127 -56 -200 -56c-147 0 -274 82 -344 200h-256
+l19 100h197c-8 32 -16 66 -16 100h-200l25 100h191c45 172 198 300 384 300z" />
+    <glyph glyph-name="5f" unicode="&#xe05f;" 
+d="M0 700h700v-100h-700v100zM0 500h500v-100h-500v100zM0 300h800v-100h-800v100zM0 100h100v-100h-100v100zM200 100h100v-100h-100v100zM400 100h100v-100h-100v100z" />
+    <glyph glyph-name="60" unicode="&#xe060;" 
+d="M0 800h800v-100h-800v100zM200 600h400l-200 -200zM0 200h800v-200h-800v200z" />
+    <glyph glyph-name="61" unicode="&#xe061;" 
+d="M0 800h100v-800h-100v800zM600 800h200v-800h-200v800zM200 600l200 -200l-200 -200v400z" />
+    <glyph glyph-name="62" unicode="&#xe062;" 
+d="M0 800h200v-800h-200v800zM700 800h100v-800h-100v800zM600 600v-400l-200 200z" />
+    <glyph glyph-name="63" unicode="&#xe063;" 
+d="M0 800h800v-200h-800v200zM400 400l200 -200h-400zM0 100h800v-100h-800v100z" />
+    <glyph glyph-name="64" unicode="&#xe064;" 
+d="M0 800h200v-100h-100v-600h600v100h100v-200h-800v800zM400 800h400v-400l-150 150l-250 -250l-100 100l250 250z" />
+    <glyph glyph-name="65" unicode="&#xe065;" 
+d="M403 700c247 0 397 -300 397 -300s-150 -300 -397 -300c-253 0 -403 300 -403 300s150 300 403 300zM400 600c-110 0 -200 -90 -200 -200s90 -200 200 -200s200 90 200 200s-90 200 -200 200zM400 500c10 0 19 -3 28 -6c-16 -8 -28 -24 -28 -44c0 -28 22 -50 50 -50
+c20 0 36 12 44 28c3 -9 6 -18 6 -28c0 -55 -45 -100 -100 -100s-100 45 -100 100s45 100 100 100z" />
+    <glyph glyph-name="66" unicode="&#xe066;" horiz-adv-x="900" 
+d="M331 700h3h3c3 1 7 1 10 1c12 0 29 -8 37 -17l94 -93l66 65c57 57 155 57 212 0c58 -58 58 -154 0 -212l-65 -66l93 -94c10 -8 18 -25 18 -38c0 -28 -22 -50 -50 -50c-13 0 -32 9 -40 20l-62 65l-381 -381h-269v272l375 381l-63 63c-9 8 -16 24 -16 36c0 20 16 42 35 48z
+M447 481l-313 -315l128 -132l316 316z" />
+    <glyph glyph-name="67" unicode="&#xe067;" 
+d="M0 800h300v-400h400v-400h-700v800zM400 800l300 -300h-300v300z" />
+    <glyph glyph-name="68" unicode="&#xe068;" 
+d="M200 800c0 0 200 -100 200 -300s-298 -302 -200 -500c0 0 -200 100 -200 300s300 300 200 500zM500 500c0 0 200 -100 200 -300c0 -150 -60 -200 -100 -200h-300c0 200 300 300 200 500z" />
+    <glyph glyph-name="69" unicode="&#xe069;" 
+d="M0 800h100v-800h-100v800zM200 800h300v-100h300l-200 -203l200 -197h-400v100h-200v400z" />
+    <glyph glyph-name="6a" unicode="&#xe06a;" horiz-adv-x="400" 
+d="M150 800h150l-100 -200h200l-150 -300h150l-300 -300l-100 300h134l66 200h-200z" />
+    <glyph glyph-name="6b" unicode="&#xe06b;" 
+d="M0 800h300v-100h500v-100h-800v200zM0 500h800v-450c0 -28 -22 -50 -50 -50h-700c-28 0 -50 22 -50 50v450z" />
+    <glyph glyph-name="6c" unicode="&#xe06c;" 
+d="M150 800c83 0 150 -67 150 -150c0 -66 -41 -121 -100 -141v-118c15 5 33 9 50 9h200c28 0 50 22 50 50v59c-59 20 -100 75 -100 141c0 83 67 150 150 150s150 -67 150 -150c0 -66 -41 -121 -100 -141v-59c0 -82 -68 -150 -150 -150h-200c-14 0 -25 -7 -34 -16
+c50 -24 84 -74 84 -134c0 -83 -67 -150 -150 -150s-150 67 -150 150c0 66 41 121 100 141v218c-59 20 -100 75 -100 141c0 83 67 150 150 150z" />
+    <glyph glyph-name="6d" unicode="&#xe06d;" 
+d="M0 800h400l-150 -150l150 -150l-100 -100l-150 150l-150 -150v400zM500 400l150 -150l150 150v-400h-400l150 150l-150 150z" />
+    <glyph glyph-name="6e" unicode="&#xe06e;" 
+d="M100 800l150 -150l150 150v-400h-400l150 150l-150 150zM400 400h400l-150 -150l150 -150l-100 -100l-150 150l-150 -150v400z" />
+    <glyph glyph-name="6f" unicode="&#xe06f;" 
+d="M400 800c221 0 400 -179 400 -400s-179 -400 -400 -400s-400 179 -400 400s179 400 400 400zM400 700c-56 0 -108 -17 -153 -44l22 -19c33 -18 13 -48 -13 -59c-30 -13 -77 10 -65 -41c13 -55 -27 -3 -47 -15c-42 -26 49 -152 31 -156l-59 34c-8 0 -13 -5 -16 -10
+c1 -30 10 -57 19 -84c28 -11 77 -2 100 -25c47 -28 97 -115 75 -159c34 -13 68 -22 106 -22c101 0 193 48 247 125c3 24 -8 44 -50 44c-69 0 -156 13 -153 97c2 46 101 108 66 143c-30 30 12 39 12 66c0 37 -65 32 -69 50s20 36 41 56c-30 10 -60 19 -94 19zM631 591
+c-38 -11 -94 -35 -87 -53c6 -15 52 -1 65 -13c11 -10 16 -59 44 -31l22 22v3c-11 26 -26 50 -44 72z" />
+    <glyph glyph-name="70" unicode="&#xe070;" 
+d="M703 800l97 -100l-400 -400l-100 100l-200 -203l-100 100l300 303l100 -100zM0 100h800v-100h-800v100z" />
+    <glyph glyph-name="71" unicode="&#xe071;" 
+d="M0 700h100v-100h-100v100zM200 700h100v-100h-100v100zM400 700h100v-100h-100v100zM600 700h100v-100h-100v100zM0 500h100v-100h-100v100zM200 500h100v-100h-100v100zM400 500h100v-100h-100v100zM600 500h100v-100h-100v100zM0 300h100v-100h-100v100zM200 300h100
+v-100h-100v100zM400 300h100v-100h-100v100zM600 300h100v-100h-100v100zM0 100h100v-100h-100v100zM200 100h100v-100h-100v100zM400 100h100v-100h-100v100zM600 100h100v-100h-100v100z" />
+    <glyph glyph-name="72" unicode="&#xe072;" 
+d="M0 800h200v-200h-200v200zM300 800h200v-200h-200v200zM600 800h200v-200h-200v200zM0 500h200v-200h-200v200zM300 500h200v-200h-200v200zM600 500h200v-200h-200v200zM0 200h200v-200h-200v200zM300 200h200v-200h-200v200zM600 200h200v-200h-200v200z" />
+    <glyph glyph-name="73" unicode="&#xe073;" 
+d="M0 800h300v-300h-300v300zM500 800h300v-300h-300v300zM0 300h300v-300h-300v300zM500 300h300v-300h-300v300z" />
+    <glyph glyph-name="74" unicode="&#xe074;" 
+d="M19 800h662c11 0 19 -8 19 -19v-331c0 -28 -22 -50 -50 -50h-600c-28 0 -50 22 -50 50v331c0 11 8 19 19 19zM0 309c16 -6 32 -9 50 -9h600c18 0 34 3 50 9v-290c0 -11 -8 -19 -19 -19h-662c-11 0 -19 8 -19 19v290zM550 200c-28 0 -50 -22 -50 -50s22 -50 50 -50
+s50 22 50 50s-22 50 -50 50z" />
+    <glyph glyph-name="75" unicode="&#xe075;" 
+d="M0 700h300v-100h-50c-28 0 -50 -22 -50 -50v-150h300v150c0 28 -22 50 -50 50h-50v100h300v-100h-50c-28 0 -50 -22 -50 -50v-400c0 -28 22 -50 50 -50h50v-100h-300v100h50c28 0 50 22 50 50v150h-300v-150c0 -28 22 -50 50 -50h50v-100h-300v100h50c28 0 50 22 50 50
+v400c0 28 -22 50 -50 50h-50v100z" />
+    <glyph glyph-name="76" unicode="&#xe076;" 
+d="M400 700c165 0 300 -135 300 -300v-100h50c28 0 50 -22 50 -50v-200c0 -28 -22 -50 -50 -50h-100c-28 0 -50 22 -50 50v350c0 111 -89 200 -200 200s-200 -89 -200 -200v-350c0 -28 -22 -50 -50 -50h-100c-28 0 -50 22 -50 50v200c0 28 22 50 50 50h50v100
+c0 165 135 300 300 300z" />
+    <glyph glyph-name="77" unicode="&#xe077;" 
+d="M0 500c0 109 91 200 200 200s200 -91 200 -200c0 109 91 200 200 200s200 -91 200 -200c0 -55 -23 -105 -59 -141l-341 -340l-341 340c-36 36 -59 86 -59 141z" />
+    <glyph glyph-name="78" unicode="&#xe078;" 
+d="M400 700l400 -300l-100 3v-403h-200v200h-200v-200h-200v400h-100z" />
+    <glyph glyph-name="79" unicode="&#xe079;" 
+d="M0 800h800v-800h-800v800zM100 700v-300l100 100l400 -400h100v100l-200 200l100 100l100 -100v300h-600z" />
+    <glyph glyph-name="7a" unicode="&#xe07a;" 
+d="M19 800h762c11 0 19 -8 19 -19v-762c0 -11 -8 -19 -19 -19h-762c-11 0 -19 8 -19 19v762c0 11 8 19 19 19zM100 600v-300h100l100 -100h200l100 100h100v300h-600z" />
+    <glyph glyph-name="7b" unicode="&#xe07b;" 
+d="M200 600c80 0 142 -56 200 -122c58 66 119 122 200 122c131 0 200 -101 200 -200s-69 -200 -200 -200c-81 0 -142 56 -200 122c-58 -66 -121 -122 -200 -122c-131 0 -200 101 -200 200s69 200 200 200zM200 500c-74 0 -100 -54 -100 -100s26 -100 100 -100
+c42 0 88 47 134 100c-46 53 -92 100 -134 100zM600 500c-43 0 -88 -47 -134 -100c46 -53 91 -100 134 -100c74 0 100 54 100 100s-26 100 -100 100z" />
+    <glyph glyph-name="7c" unicode="&#xe07c;" horiz-adv-x="400" 
+d="M300 800c55 0 100 -45 100 -100s-45 -100 -100 -100s-100 45 -100 100s45 100 100 100zM150 550c83 0 150 -69 150 -150c0 -66 -100 -214 -100 -250c0 -28 22 -50 50 -50s50 22 50 50h100c0 -83 -67 -150 -150 -150s-150 64 -150 150s100 222 100 250s-22 50 -50 50
+s-50 -22 -50 -50h-100c0 83 67 150 150 150z" />
+    <glyph glyph-name="7d" unicode="&#xe07d;" 
+d="M200 800h500v-100h-122c-77 -197 -156 -392 -234 -588l-6 -12h162v-100h-500v100h122c77 197 156 392 234 588l7 12h-163v100z" />
+    <glyph glyph-name="7e" unicode="&#xe07e;" 
+d="M0 700h800v-100h-800v100zM0 500h800v-100h-800v100zM0 300h800v-100h-800v100zM100 100h600v-100h-600v100z" />
+    <glyph glyph-name="7f" unicode="&#xe07f;" 
+d="M0 700h800v-100h-800v100zM0 500h800v-100h-800v100zM0 300h800v-100h-800v100zM0 100h600v-100h-600v100z" />
+    <glyph glyph-name="80" unicode="&#xe080;" 
+d="M0 700h800v-100h-800v100zM0 500h800v-100h-800v100zM0 300h800v-100h-800v100zM200 100h600v-100h-600v100z" />
+    <glyph glyph-name="81" unicode="&#xe081;" 
+d="M550 800c138 0 250 -112 250 -250s-112 -250 -250 -250c-16 0 -32 0 -47 3l-3 -3v-100h-200v-200h-300v200l303 303c-3 15 -3 31 -3 47c0 138 112 250 250 250zM600 700c-55 0 -100 -45 -100 -100s45 -100 100 -100s100 45 100 100s-45 100 -100 100z" />
+    <glyph glyph-name="82" unicode="&#xe082;" 
+d="M134 600h3h4h4h5h500c28 0 50 -22 50 -50v-350h100v-150c0 -28 -22 -50 -50 -50h-700c-28 0 -50 22 -50 50v150h100v350v2c0 20 15 42 34 48zM200 500v-300h100v-100h200v100h100v300h-400z" />
+    <glyph glyph-name="83" unicode="&#xe083;" 
+d="M0 800h400v-400h-400v400zM500 600h100v-400h-400v100h300v300zM700 400h100v-400h-400v100h300v300z" />
+    <glyph glyph-name="84" unicode="&#xe084;" horiz-adv-x="600" 
+d="M337 694c6 4 12 7 21 7c28 0 50 -22 50 -50c0 -17 -12 -37 -27 -45l-300 -150c-8 -6 -21 -11 -31 -11c-28 0 -50 22 -50 50c0 21 16 44 37 49zM437 544c6 4 12 7 21 7c28 0 50 -22 50 -50c0 -17 -12 -37 -27 -45l-400 -200c-8 -6 -21 -11 -31 -11c-28 0 -50 22 -50 50
+c0 21 16 44 37 49zM437 344c6 4 12 7 21 7c28 0 50 -22 50 -50c0 -17 -12 -37 -27 -45l-106 -56c24 -4 43 -26 43 -50c0 -28 -23 -51 -51 -51c-2 0 -6 1 -8 1h-200c-26 1 -48 24 -48 50c0 16 12 36 26 44zM151 -50c0 23 20 50 46 50h3h4h5h100c28 0 50 -22 50 -50
+s-22 -50 -50 -50h-100c-2 0 -6 -1 -8 -1c-28 0 -50 23 -50 51z" />
+    <glyph glyph-name="85" unicode="&#xe085;" 
+d="M199 800h100v-200h-200v100h100v100zM586 797h1c18 1 38 1 56 -3c36 -8 69 -26 97 -54c78 -78 78 -203 0 -281l-150 -150c-8 -13 -28 -24 -43 -24c-28 0 -50 22 -50 50c0 15 11 35 24 43l150 150c40 40 39 105 0 144c-41 41 -110 34 -144 0l-44 -44
+c-8 -13 -27 -24 -42 -24c-28 0 -50 22 -50 50c0 15 11 35 24 43l43 44c32 33 72 53 128 56zM208 490c4 5 14 16 22 16h3c2 0 6 1 8 1c28 0 50 -22 50 -50c0 -11 -6 -27 -14 -35l-150 -150c-40 -40 -39 -105 0 -144c41 -41 110 -34 144 0l44 44c8 13 27 24 42 24
+c28 0 50 -22 50 -50c0 -15 -11 -35 -24 -43l-43 -44c-22 -22 -48 -37 -75 -47c-70 -25 -151 -9 -207 47c-78 78 -78 203 0 281zM499 200h200v-100h-100v-100h-100v200z" />
+    <glyph glyph-name="86" unicode="&#xe086;" 
+d="M586 797c18 1 39 1 57 -3c36 -8 69 -26 97 -54c78 -78 78 -203 0 -281l-150 -150c-62 -62 -132 -81 -182 -78s-69 17 -84 25s-26 27 -26 44c0 28 22 51 50 51c8 0 19 -3 26 -7c0 0 15 -11 41 -13s62 3 106 47l150 150c40 40 39 105 0 144c-41 41 -110 34 -144 0
+c-8 -13 -28 -24 -43 -24c-28 0 -50 22 -50 50c0 15 11 35 24 43c32 33 72 53 128 56zM386 566c50 -2 64 -17 85 -22s37 -28 37 -49c0 -28 -22 -50 -50 -50c-10 0 -23 5 -31 11c0 0 -19 9 -47 10s-63 -4 -103 -44l-150 -150c-40 -40 -39 -105 0 -144c41 -41 110 -34 144 0
+c8 13 27 24 42 24c28 0 50 -22 50 -50c0 -15 -10 -35 -23 -43c-22 -22 -48 -37 -75 -47c-70 -25 -151 -9 -207 47c-78 78 -78 203 0 281l150 150c60 60 128 78 178 76z" />
+    <glyph glyph-name="87" unicode="&#xe087;" 
+d="M0 700h300v-300h-300v300zM400 700h400v-100h-400v100zM400 500h300v-100h-300v100zM0 300h300v-300h-300v300zM400 300h400v-100h-400v100zM400 100h300v-100h-300v100z" />
+    <glyph glyph-name="88" unicode="&#xe088;" 
+d="M50 700c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM200 700h600v-100h-600v100zM50 500c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM200 500h600v-100h-600v100zM50 300c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50
+s22 50 50 50zM200 300h600v-100h-600v100zM50 100c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM200 100h600v-100h-600v100z" />
+    <glyph glyph-name="89" unicode="&#xe089;" 
+d="M800 800l-400 -800l-100 300l-300 100z" />
+    <glyph glyph-name="8a" unicode="&#xe08a;" horiz-adv-x="600" 
+d="M300 700c110 0 200 -90 200 -200v-100h100v-400h-600v400h100v100c0 110 90 200 200 200zM300 600c-56 0 -100 -44 -100 -100v-100h200v100c0 56 -44 100 -100 100z" />
+    <glyph glyph-name="8b" unicode="&#xe08b;" horiz-adv-x="600" 
+d="M300 800c110 0 200 -90 200 -200v-200h100v-400h-600v400h400v200c0 56 -44 100 -100 100s-100 -44 -100 -100h-100c0 110 90 200 200 200z" />
+    <glyph glyph-name="8c" unicode="&#xe08c;" 
+d="M400 700v-100c-111 0 -200 -89 -200 -200h100l-150 -200l-150 200h100c0 165 135 300 300 300zM650 600l150 -200h-100c0 -165 -135 -300 -300 -300v100c111 0 200 89 200 200h-100z" />
+    <glyph glyph-name="8d" unicode="&#xe08d;" 
+d="M100 800h600v-300h100l-150 -250l-150 250h100v200h-400v-100h-100v200zM150 550l150 -250h-100v-200h400v100h100v-200h-600v300h-100z" />
+    <glyph glyph-name="8e" unicode="&#xe08e;" 
+d="M600 700l200 -150l-200 -150v100h-500v-100h-100v100c0 55 45 100 100 100h500v100zM200 300v-100h500v100h100v-100c0 -55 -45 -100 -100 -100h-500v-100l-200 150z" />
+    <glyph glyph-name="8f" unicode="&#xe08f;" horiz-adv-x="900" 
+d="M350 800c193 0 350 -157 350 -350c0 -60 -17 -117 -44 -166c5 -3 12 -8 16 -12l100 -100c16 -16 30 -49 30 -72c0 -56 -46 -102 -102 -102c-23 0 -56 14 -72 30l-100 100c-4 3 -9 9 -12 13c-49 -26 -107 -41 -166 -41c-193 0 -350 157 -350 350s157 350 350 350zM350 200
+c142 0 250 108 250 250c0 139 -111 250 -250 250s-250 -111 -250 -250s111 -250 250 -250z" />
+    <glyph glyph-name="90" unicode="&#xe090;" horiz-adv-x="600" 
+d="M300 800c166 0 300 -134 300 -300c0 -200 -300 -500 -300 -500s-300 300 -300 500c0 166 134 300 300 300zM300 700c-110 0 -200 -90 -200 -200s90 -200 200 -200s200 90 200 200s-90 200 -200 200z" />
+    <glyph glyph-name="91" unicode="&#xe091;" horiz-adv-x="900" 
+d="M0 800h800v-541c1 -3 1 -8 1 -11s0 -7 -1 -10v-238h-800v800zM495 250c0 26 22 50 50 50h5h150v400h-600v-600h600v100h-150h-5c-28 0 -50 22 -50 50zM350 600c83 0 150 -67 150 -150c0 -100 -150 -250 -150 -250s-150 150 -150 250c0 83 67 150 150 150zM350 500
+c-28 0 -50 -22 -50 -50s22 -50 50 -50s50 22 50 50s-22 50 -50 50z" />
+    <glyph glyph-name="92" unicode="&#xe092;" horiz-adv-x="600" 
+d="M0 700h200v-600h-200v600zM400 700h200v-600h-200v600z" />
+    <glyph glyph-name="93" unicode="&#xe093;" horiz-adv-x="600" 
+d="M0 700l600 -300l-600 -300v600z" />
+    <glyph glyph-name="94" unicode="&#xe094;" horiz-adv-x="600" 
+d="M300 700c166 0 300 -134 300 -300s-134 -300 -300 -300s-300 134 -300 300s134 300 300 300z" />
+    <glyph glyph-name="95" unicode="&#xe095;" 
+d="M400 700v-600l-400 300zM400 400l400 300v-600z" />
+    <glyph glyph-name="96" unicode="&#xe096;" 
+d="M0 700l400 -300l-400 -300v600zM400 100v600l400 -300z" />
+    <glyph glyph-name="97" unicode="&#xe097;" 
+d="M0 700h200v-600h-200v600zM200 400l500 300v-600z" />
+    <glyph glyph-name="98" unicode="&#xe098;" 
+d="M0 700l500 -300l-500 -300v600zM500 100v600h200v-600h-200z" />
+    <glyph glyph-name="99" unicode="&#xe099;" horiz-adv-x="600" 
+d="M0 700h600v-600h-600v600z" />
+    <glyph glyph-name="9a" unicode="&#xe09a;" 
+d="M200 800h400v-200h200v-400h-200v-200h-400v200h-200v400h200v200z" />
+    <glyph glyph-name="9b" unicode="&#xe09b;" 
+d="M0 700h800v-100h-800v100zM0 403h800v-100h-800v100zM0 103h800v-100h-800v100z" />
+    <glyph glyph-name="9c" unicode="&#xe09c;" horiz-adv-x="600" 
+d="M278 700c7 2 13 4 22 4c55 0 100 -45 100 -100v-4v-200c0 -55 -45 -100 -100 -100s-100 45 -100 100v200v2c0 44 35 88 78 98zM34 500h4h3c3 0 6 1 9 1c28 0 50 -22 50 -50v-1v-50c0 -111 89 -200 200 -200s200 89 200 200v50c0 28 22 50 50 50s50 -22 50 -50v-50
+c0 -148 -109 -270 -250 -294v-106h50c55 0 100 -45 100 -100h-400c0 55 45 100 100 100h50v106c-141 24 -250 146 -250 294v50v2c0 20 15 42 34 48z" />
+    <glyph glyph-name="9d" unicode="&#xe09d;" 
+d="M0 500h800v-200h-800v200z" />
+    <glyph glyph-name="9e" unicode="&#xe09e;" 
+d="M34 700h4h3h4h5h700c28 0 50 -22 50 -50v-500c0 -28 -22 -50 -50 -50h-250v-100h100c55 0 100 -45 100 -100h-600c0 55 45 100 100 100h100v100h-250c-28 0 -50 22 -50 50v500v2c0 20 15 42 34 48zM100 600v-400h600v400h-600z" />
+    <glyph glyph-name="9f" unicode="&#xe09f;" 
+d="M272 700c-14 -40 -22 -83 -22 -128c0 -221 179 -400 400 -400c45 0 88 8 128 22c-53 -158 -202 -272 -378 -272c-221 0 -400 179 -400 400c0 176 114 325 272 378z" />
+    <glyph glyph-name="a0" unicode="&#xe0a0;" 
+d="M350 700l150 -150h-100v-150h150v100l150 -150l-150 -150v100h-150v-150h100l-150 -150l-150 150h100v150h-150v-100l-150 150l150 150v-100h150v150h-100z" />
+    <glyph glyph-name="a1" unicode="&#xe0a1;" 
+d="M800 800v-550c0 -83 -67 -150 -150 -150s-150 67 -150 150s67 150 150 150c17 0 35 -4 50 -9v206c-201 -6 -327 -27 -400 -50v-397c0 -83 -67 -150 -150 -150s-150 67 -150 150s67 150 150 150c17 0 35 -4 50 -9v409s100 100 600 100z" />
+    <glyph glyph-name="a2" unicode="&#xe0a2;" horiz-adv-x="700" 
+d="M499 700c51 0 102 -20 141 -59c78 -78 78 -203 0 -281l-250 -244c-48 -48 -127 -48 -175 0s-48 127 0 175l96 97l69 -69l-90 -94l-7 -3c-10 -10 -10 -28 0 -38s28 -10 38 0l250 247c37 40 39 102 0 141s-104 40 -144 0l-278 -275c-66 -69 -68 -179 0 -247
+c69 -69 181 -69 250 0l9 12l116 113l69 -69l-125 -125c-107 -107 -281 -107 -388 0s-107 281 0 388l278 272c39 39 90 59 141 59z" />
+    <glyph glyph-name="a3" unicode="&#xe0a3;" 
+d="M600 800l200 -200l-100 -100l-200 200zM400 600l200 -200l-400 -400h-200v200z" />
+    <glyph glyph-name="a4" unicode="&#xe0a4;" 
+d="M550 800c83 0 150 -90 150 -200s-67 -200 -150 -200c-22 0 -40 8 -59 19c6 26 9 52 9 81c0 84 -27 158 -72 212c27 52 71 88 122 88zM250 700c83 0 150 -90 150 -200s-67 -200 -150 -200s-150 90 -150 200s67 200 150 200zM725 384c44 -22 75 -66 75 -118v-166h-200v66
+c0 50 -17 96 -44 134c66 2 126 33 169 84zM75 284c45 -53 106 -84 175 -84s130 31 175 84c44 -22 75 -66 75 -118v-166h-500v166c0 52 31 96 75 118z" />
+    <glyph glyph-name="a5" unicode="&#xe0a5;" 
+d="M400 800c110 0 200 -112 200 -250s-90 -250 -200 -250s-200 112 -200 250s90 250 200 250zM191 300c54 -61 128 -100 209 -100s155 39 209 100c106 -5 191 -92 191 -200v-100h-800v100c0 108 85 195 191 200z" />
+    <glyph glyph-name="a6" unicode="&#xe0a6;" horiz-adv-x="600" 
+d="M19 800h462c11 0 19 -8 19 -19v-762c0 -11 -8 -19 -19 -19h-462c-11 0 -19 8 -19 19v762c0 11 8 19 19 19zM100 700v-500h300v500h-300zM250 150c-28 0 -50 -22 -50 -50s22 -50 50 -50s50 22 50 50s-22 50 -50 50z" />
+    <glyph glyph-name="a7" unicode="&#xe0a7;" 
+d="M350 800c17 0 34 -1 50 -3v-397l-297 297c63 64 150 103 247 103zM500 694c169 -25 300 -168 300 -344c0 -193 -157 -350 -350 -350c-85 0 -161 31 -222 81l272 272v341zM91 562l237 -234l-212 -212c-70 55 -116 138 -116 234c0 84 35 158 91 212z" />
+    <glyph glyph-name="a8" unicode="&#xe0a8;" 
+d="M92 650c0 23 20 50 46 50h3h4h5h400c28 0 50 -22 50 -50s-22 -50 -50 -50h-50v-200h100c55 0 100 -45 100 -100h-300v-300l-56 -100l-44 100v300h-300c0 55 45 100 100 100h100v200h-50c-2 0 -6 -1 -8 -1c-28 0 -50 23 -50 51z" />
+    <glyph glyph-name="a9" unicode="&#xe0a9;" 
+d="M400 800c221 0 400 -179 400 -400s-179 -400 -400 -400s-400 179 -400 400s179 400 400 400zM300 600v-400l300 200z" />
+    <glyph glyph-name="aa" unicode="&#xe0aa;" 
+d="M300 800h200v-300h300v-200h-300v-300h-200v300h-300v200h300v300z" />
+    <glyph glyph-name="ab" unicode="&#xe0ab;" 
+d="M300 800h100v-400h-100v400zM172 656l62 -78l-40 -31c-58 -46 -94 -117 -94 -197c0 -139 111 -250 250 -250s250 111 250 250c0 80 -39 151 -97 197l-37 31l62 78l38 -31c82 -64 134 -164 134 -275c0 -193 -157 -350 -350 -350s-350 157 -350 350c0 111 53 211 134 275z
+" />
+    <glyph glyph-name="ac" unicode="&#xe0ac;" 
+d="M200 800h400v-200h-400v200zM9 500h782c6 0 9 -3 9 -9v-282c0 -6 -3 -9 -9 -9h-91v200h-600v-200h-91c-6 0 -9 3 -9 9v282c0 6 3 9 9 9zM200 300h400v-300h-400v300z" />
+    <glyph glyph-name="ad" unicode="&#xe0ad;" 
+d="M0 700h100v-700h-100v700zM700 700h100v-700h-100v700zM200 600h200v-100h-200v100zM300 400h200v-100h-200v100zM400 200h200v-100h-200v100z" />
+    <glyph glyph-name="ae" unicode="&#xe0ae;" 
+d="M325 700c42 -141 87 -280 131 -419c29 74 59 148 88 222c30 -57 58 -114 87 -172h169v-100h-231l-13 28c-37 -92 -74 -184 -112 -275c-38 129 -79 257 -119 385c-42 -133 -83 -267 -125 -400c-28 88 -56 175 -84 262h-116v100h188l9 -34l3 -6c42 137 83 273 125 409z" />
+    <glyph glyph-name="af" unicode="&#xe0af;" 
+d="M200 600c0 57 43 100 100 100s100 -43 100 -100c0 -28 -18 -48 -28 -72c-3 -6 -3 -16 -3 -28h231v-231c12 0 22 0 28 3c24 10 44 28 72 28c57 0 100 -43 100 -100s-43 -100 -100 -100c-28 0 -48 18 -72 28c-6 3 -16 3 -28 3v-231h-231c0 12 0 22 3 28c10 24 28 44 28 72
+c0 57 -43 100 -100 100s-100 -43 -100 -100c0 -28 18 -48 28 -72c3 -6 3 -16 3 -28h-231v600h231c0 12 0 22 -3 28c-10 24 -28 44 -28 72z" />
+    <glyph glyph-name="b0" unicode="&#xe0b0;" horiz-adv-x="500" 
+d="M247 700c84 0 148 -20 191 -59s59 -93 59 -141c0 -117 -69 -181 -119 -225s-81 -67 -81 -150v-25h-100v25c0 117 65 181 115 225s85 67 85 150c0 25 -8 48 -28 66s-56 34 -122 34s-97 -18 -116 -37s-27 -43 -31 -69l-100 12c5 38 19 88 59 128s103 66 188 66zM197 0h100
+v-100h-100v100z" />
+    <glyph glyph-name="b1" unicode="&#xe0b1;" 
+d="M450 800c138 0 250 -112 250 -250v-50c58 -21 100 -85 100 -150c0 -69 -48 -127 -112 -144c-22 55 -75 94 -138 94c-20 0 -39 -5 -56 -12c-17 64 -75 112 -144 112s-127 -48 -144 -112c-17 7 -36 12 -56 12c-37 0 -71 -12 -97 -34c-33 36 -53 82 -53 134
+c0 110 90 200 200 200c23 114 129 200 250 200zM334 300h4h3c3 0 6 1 9 1c28 0 50 -22 50 -50v-1v-200c0 -28 -22 -50 -50 -50s-50 22 -50 50v200v2c0 20 15 42 34 48zM134 200h4h3c3 0 6 1 9 1c28 0 50 -22 50 -50v-1v-100c0 -28 -22 -50 -50 -50s-50 22 -50 50v100v2
+c0 20 15 42 34 48zM534 200h3h4c3 0 6 1 9 1c28 0 50 -22 50 -50v-1v-100c0 -28 -22 -50 -50 -50s-50 22 -50 50v100v2c0 20 15 42 34 48z" />
+    <glyph glyph-name="b2" unicode="&#xe0b2;" 
+d="M600 800l200 -150l-200 -150v100h-50l-153 -191l175 -206l6 -3h22v100l200 -150l-200 -150v100h-25c-35 0 -56 12 -78 38l-166 190l-153 -190c-22 -27 -43 -38 -78 -38h-100v100h100l166 206l-163 191l-3 3h-100v100h100c34 0 56 -12 78 -38l153 -178l141 178
+c22 27 43 38 78 38h50v100z" />
+    <glyph glyph-name="b3" unicode="&#xe0b3;" 
+d="M400 800c110 0 209 -47 281 -119l119 119v-300h-300l109 109c-54 55 -126 91 -209 91c-166 0 -300 -134 -300 -300s134 -300 300 -300c83 0 158 34 212 88l72 -72c-72 -72 -174 -116 -284 -116c-220 0 -400 180 -400 400s180 400 400 400z" />
+    <glyph glyph-name="b4" unicode="&#xe0b4;" 
+d="M400 800h400v-400l-166 166l-400 -400l166 -166h-400v400l166 -166l400 400z" />
+    <glyph glyph-name="b5" unicode="&#xe0b5;" horiz-adv-x="600" 
+d="M250 800l250 -300h-200v-200h200l-250 -300l-250 300h200v200h-200z" />
+    <glyph glyph-name="b6" unicode="&#xe0b6;" 
+d="M300 600v-200h200v200l300 -250l-300 -250v200h-200v-200l-300 250z" />
+    <glyph glyph-name="b7" unicode="&#xe0b7;" 
+d="M0 800c441 0 800 -359 800 -800h-200c0 333 -267 600 -600 600v200zM0 500c275 0 500 -225 500 -500h-200c0 167 -133 300 -300 300v200zM0 200c110 0 200 -90 200 -200h-200v200z" />
+    <glyph glyph-name="b8" unicode="&#xe0b8;" 
+d="M100 800c386 0 700 -314 700 -700h-100c0 332 -268 600 -600 600v100zM100 600c276 0 500 -224 500 -500h-100c0 222 -178 400 -400 400v100zM100 400c165 0 300 -135 300 -300h-100c0 111 -89 200 -200 200v100zM100 200c55 0 100 -45 100 -100s-45 -100 -100 -100
+s-100 45 -100 100s45 100 100 100z" />
+    <glyph glyph-name="b9" unicode="&#xe0b9;" 
+d="M300 800h400c55 0 100 -45 100 -100v-200h-400v150c0 28 -22 50 -50 50s-50 -22 -50 -50v-250h400v-300c0 -55 -45 -100 -100 -100h-500c-55 0 -100 45 -100 100v200h100v-150c0 -28 22 -50 50 -50s50 22 50 50v550c0 55 45 100 100 100z" />
+    <glyph glyph-name="ba" unicode="&#xe0ba;" 
+d="M75 700h225v-100h-200v-500h400v100h100v-125c0 -41 -34 -75 -75 -75h-450c-41 0 -75 34 -75 75v550c0 41 34 75 75 75zM600 700l200 -200l-200 -200v100h-200c-94 0 -173 -65 -194 -153c23 199 189 353 394 353v100z" />
+    <glyph glyph-name="bb" unicode="&#xe0bb;" 
+d="M500 700l300 -284l-300 -316v200h-100c-200 0 -348 -102 -400 -300c0 295 100 500 500 500v200z" />
+    <glyph glyph-name="bc" unicode="&#xe0bc;" 
+d="M381 791l19 9l19 -9c127 -53 253 -108 381 -160v-31c0 -166 -67 -313 -147 -419c-40 -53 -83 -97 -125 -128s-82 -53 -128 -53s-86 22 -128 53s-85 75 -125 128c-80 107 -147 253 -147 419v31c128 52 254 107 381 160zM400 100v591l-294 -122c8 -126 58 -243 122 -328
+c35 -46 73 -86 106 -110s62 -31 66 -31z" />
+    <glyph glyph-name="bd" unicode="&#xe0bd;" 
+d="M600 800h100v-800h-100v800zM400 700h100v-700h-100v700zM200 500h100v-500h-100v500zM0 300h100v-300h-100v300z" />
+    <glyph glyph-name="be" unicode="&#xe0be;" 
+d="M300 800h100v-200h200l100 -100l-100 -100h-200v-400h-100v500h-200l-100 100l100 100h200v100z" />
+    <glyph glyph-name="bf" unicode="&#xe0bf;" 
+d="M200 800h100v-600h200l-250 -200l-250 200h200v600zM400 800h200v-100h-200v100zM400 600h300v-100h-300v100zM400 400h400v-100h-400v100z" />
+    <glyph glyph-name="c0" unicode="&#xe0c0;" 
+d="M200 800h100v-600h200l-250 -200l-250 200h200v600zM400 800h400v-100h-400v100zM400 600h300v-100h-300v100zM400 400h200v-100h-200v100z" />
+    <glyph glyph-name="c1" unicode="&#xe0c1;" 
+d="M75 700h650c41 0 75 -34 75 -75v-550c0 -41 -34 -75 -75 -75h-650c-41 0 -75 34 -75 75v550c0 41 34 75 75 75zM100 600v-100h100v100h-100zM300 600v-100h400v100h-400zM100 400v-100h100v100h-100zM300 400v-100h400v100h-400zM100 200v-100h100v100h-100zM300 200
+v-100h400v100h-400z" />
+    <glyph glyph-name="c2" unicode="&#xe0c2;" 
+d="M400 800l100 -300h300l-250 -200l100 -300l-250 200l-250 -200l100 300l-250 200h300z" />
+    <glyph glyph-name="c3" unicode="&#xe0c3;" 
+d="M400 800c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM150 700c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM650 700c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM400 600c110 0 200 -90 200 -200
+s-90 -200 -200 -200s-200 90 -200 200s90 200 200 200zM50 450c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM750 450c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM150 200c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50
+s22 50 50 50zM650 200c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50zM400 100c28 0 50 -22 50 -50s-22 -50 -50 -50s-50 22 -50 50s22 50 50 50z" />
+    <glyph glyph-name="c4" unicode="&#xe0c4;" 
+d="M34 800h632c18 0 34 -16 34 -34v-732c0 -18 -16 -34 -34 -34h-632c-18 0 -34 16 -34 34v732c0 18 16 34 34 34zM100 700v-500h500v500h-500zM350 150c-38 0 -63 -42 -44 -75s69 -33 88 0s-6 75 -44 75z" />
+    <glyph glyph-name="c5" unicode="&#xe0c5;" 
+d="M0 800h300l500 -500l-300 -300l-500 500v300zM200 700c-55 0 -100 -45 -100 -100s45 -100 100 -100s100 45 100 100s-45 100 -100 100z" />
+    <glyph glyph-name="c6" unicode="&#xe0c6;" 
+d="M0 600h200l300 -300l-200 -200l-300 300v200zM340 600h160l300 -300l-200 -200l-78 78l119 122zM150 500c-28 0 -50 -22 -50 -50s22 -50 50 -50s50 22 50 50s-22 50 -50 50z" />
+    <glyph glyph-name="c7" unicode="&#xe0c7;" 
+d="M400 800c220 0 400 -180 400 -400s-180 -400 -400 -400s-400 180 -400 400s180 400 400 400zM400 700c-166 0 -300 -134 -300 -300s134 -300 300 -300s300 134 300 300s-134 300 -300 300zM400 600c110 0 200 -90 200 -200s-90 -200 -200 -200s-200 90 -200 200
+s90 200 200 200zM400 500c-56 0 -100 -44 -100 -100s44 -100 100 -100s100 44 100 100s-44 100 -100 100z" />
+    <glyph glyph-name="c8" unicode="&#xe0c8;" 
+d="M0 700h559l-100 -100h-359v-500h500v159l100 100v-359h-700v700zM700 700l100 -100l-400 -400l-200 200l100 100l100 -100z" />
+    <glyph glyph-name="c9" unicode="&#xe0c9;" 
+d="M9 800h782c6 0 9 -3 9 -9v-782c0 -6 -3 -9 -9 -9h-782c-6 0 -9 3 -9 9v782c0 6 3 9 9 9zM150 722l-72 -72l100 -100l-100 -100l72 -72l172 172zM400 500v-100h300v100h-300z" />
+    <glyph glyph-name="ca" unicode="&#xe0ca;" 
+d="M0 800h800v-200h-50c0 55 -45 100 -100 100h-150v-550c0 -28 22 -50 50 -50h50v-100h-400v100h50c28 0 50 22 50 50v550h-150c-55 0 -100 -45 -100 -100h-50v200z" />
+    <glyph glyph-name="cb" unicode="&#xe0cb;" 
+d="M0 700h100v-400h-100v400zM200 700h350c21 0 39 -13 47 -31c0 0 103 -291 103 -319s-22 -50 -50 -50h-150c-28 0 -50 -25 -50 -50s39 -158 47 -184s-5 -55 -31 -63s-52 5 -66 31s-109 219 -128 238s-44 28 -72 28v400z" />
+    <glyph glyph-name="cc" unicode="&#xe0cc;" 
+d="M400 666c10 19 28 32 47 34l19 -3c26 -8 39 -37 31 -63s-47 -159 -47 -184s22 -50 50 -50h150c28 0 50 -22 50 -50s-103 -319 -103 -319c-8 -18 -26 -31 -47 -31h-350v400c28 0 53 9 72 28s114 212 128 238zM0 400h100v-400h-100v400z" />
+    <glyph glyph-name="cd" unicode="&#xe0cd;" 
+d="M200 700h300v-100h-100v-6c25 -4 50 -8 72 -16l-34 -94c-28 11 -58 16 -88 16c-139 0 -250 -111 -250 -250s111 -250 250 -250s250 111 250 250c0 31 -5 60 -16 88l91 37c14 -38 25 -81 25 -125c0 -193 -157 -350 -350 -350s-350 157 -350 350c0 176 130 323 300 347v3
+h-100v100zM700 584c0 0 -296 -348 -316 -368s-48 -20 -68 0s-20 48 0 68s384 300 384 300z" />
+    <glyph glyph-name="ce" unicode="&#xe0ce;" 
+d="M600 700l200 -150l-200 -150v100h-600v100h600v100zM200 300v-100h600v-100h-600v-100l-200 150z" />
+    <glyph glyph-name="cf" unicode="&#xe0cf;" 
+d="M300 800h100c55 0 100 -45 100 -100h100c55 0 100 -45 100 -100h-700c0 55 45 100 100 100h100c0 55 45 100 100 100zM100 500h100v-350c0 -28 22 -50 50 -50s50 22 50 50v350h100v-350c0 -28 22 -50 50 -50s50 22 50 50v350h100v-481c0 -11 -8 -19 -19 -19h-462
+c-11 0 -19 8 -19 19v481z" />
+    <glyph glyph-name="d0" unicode="&#xe0d0;" 
+d="M100 800h200v-400c0 -55 45 -100 100 -100s100 45 100 100v400h100v-400c0 -110 -90 -200 -200 -200h-50c-138 0 -250 90 -250 200v400zM0 100h700v-100h-700v100z" />
+    <glyph glyph-name="d1" unicode="&#xe0d1;" 
+d="M9 700h182c6 0 9 -3 9 -9v-482c0 -6 -3 -9 -9 -9h-182c-6 0 -9 3 -9 9v482c0 6 3 9 9 9zM609 700h182c6 0 9 -3 9 -9v-482c0 -6 -3 -9 -9 -9h-182c-6 0 -9 3 -9 9v482c0 6 3 9 9 9zM309 500h182c6 0 9 -3 9 -9v-282c0 -6 -3 -9 -9 -9h-182c-6 0 -9 3 -9 9v282
+c0 6 3 9 9 9zM0 100h800v-100h-800v100z" />
+    <glyph glyph-name="d2" unicode="&#xe0d2;" 
+d="M10 700h181c6 0 9 -3 9 -9v-191h-200v191c0 6 4 9 10 9zM610 700h181c6 0 9 -3 9 -9v-191h-200v191c0 6 5 9 10 9zM310 600h181c6 0 9 -3 9 -9v-91h-200v91c0 6 4 9 10 9zM0 400h800v-100h-800v100zM0 200h200v-191c0 -6 -3 -9 -9 -9h-182c-6 0 -9 3 -9 9v191zM300 200
+h200v-91c0 -6 -3 -9 -9 -9h-181c-6 0 -10 3 -10 9v91zM600 200h200v-191c0 -6 -3 -9 -9 -9h-181c-6 0 -10 3 -10 9v191z" />
+    <glyph glyph-name="d3" unicode="&#xe0d3;" 
+d="M0 700h800v-100h-800v100zM9 500h182c6 0 9 -3 9 -9v-482c0 -6 -3 -9 -9 -9h-182c-6 0 -9 3 -9 9v482c0 6 3 9 9 9zM309 500h182c6 0 9 -3 9 -9v-282c0 -6 -3 -9 -9 -9h-182c-6 0 -9 3 -9 9v282c0 6 3 9 9 9zM609 500h182c6 0 9 -3 9 -9v-482c0 -6 -3 -9 -9 -9h-182
+c-6 0 -9 3 -9 9v482c0 6 3 9 9 9z" />
+    <glyph glyph-name="d4" unicode="&#xe0d4;" 
+d="M50 600h500c28 0 50 -22 50 -50v-150l100 100h100v-300h-100l-100 100v-150c0 -28 -22 -50 -50 -50h-500c-28 0 -50 22 -50 50v400c0 28 22 50 50 50z" />
+    <glyph glyph-name="d5" unicode="&#xe0d5;" 
+d="M334 800h66v-800h-66l-134 200h-200v400h200zM500 600v100c26 0 52 -4 75 -10c130 -33 225 -150 225 -290s-95 -258 -225 -291h-3c-23 -6 -47 -9 -72 -9v100c17 0 34 2 50 6c86 22 150 100 150 194s-64 172 -150 194c-16 4 -33 6 -50 6zM500 500l25 -3
+c44 -11 75 -51 75 -97s-32 -86 -75 -97l-25 -3v200z" />
+    <glyph glyph-name="d6" unicode="&#xe0d6;" horiz-adv-x="600" 
+d="M334 800h66v-800h-66l-134 200h-200v400h200zM500 500l25 -3c44 -11 75 -51 75 -97s-32 -86 -75 -97l-25 -3v200z" />
+    <glyph glyph-name="d7" unicode="&#xe0d7;" horiz-adv-x="400" 
+d="M334 800h66v-800h-66l-134 200h-200v400h200z" />
+    <glyph glyph-name="d8" unicode="&#xe0d8;" 
+d="M309 800h82c6 0 10 -4 12 -9l294 -682l3 -19v-81c0 -6 -3 -9 -9 -9h-682c-6 0 -9 3 -9 9v81l3 19l294 682c2 5 6 9 12 9zM300 500v-200h100v200h-100zM300 200v-100h100v100h-100z" />
+    <glyph glyph-name="d9" unicode="&#xe0d9;" 
+d="M375 800c138 0 269 -39 378 -109l-53 -82c-93 60 -205 91 -325 91c-119 0 -229 -32 -322 -91l-53 82c109 70 237 109 375 109zM375 500c78 0 154 -23 216 -62l-53 -85c-46 30 -104 47 -163 47c-60 0 -112 -17 -159 -47l-54 85c62 40 134 62 213 62zM375 200
+c55 0 100 -45 100 -100s-45 -100 -100 -100s-100 45 -100 100s45 100 100 100z" />
+    <glyph glyph-name="da" unicode="&#xe0da;" horiz-adv-x="900" 
+d="M551 800c16 0 32 0 47 -3l-97 -97v-200h200l97 97c3 -15 3 -31 3 -47c0 -138 -112 -250 -250 -250c-32 0 -62 8 -90 19l-288 -291c-20 -20 -46 -28 -72 -28s-52 8 -72 28c-39 39 -39 105 0 144l291 287c-11 28 -19 59 -19 91c0 138 112 250 250 250zM101 150
+c-28 0 -50 -22 -50 -50s22 -50 50 -50s50 22 50 50s-22 50 -50 50z" />
+    <glyph glyph-name="db" unicode="&#xe0db;" 
+d="M141 700c84 -84 169 -167 253 -250c82 83 167 165 247 250l143 -141l-253 -253c84 -82 167 -166 253 -247l-143 -143c-81 86 -165 169 -247 253l-253 -253l-141 143c85 80 167 164 250 247c-83 84 -166 169 -250 253z" />
+    <glyph glyph-name="dc" unicode="&#xe0dc;" 
+d="M0 800h100l231 -300h38l231 300h100l-225 -300h225v-100h-300v-100h300v-100h-300v-200h-100v200h-300v100h300v100h-300v100h225z" />
+    <glyph glyph-name="dd" unicode="&#xe0dd;" horiz-adv-x="900" 
+d="M350 800c193 0 350 -157 350 -350c0 -61 -17 -119 -44 -169c4 -2 10 -6 13 -9l103 -100c16 -16 30 -49 30 -72c0 -56 -46 -102 -102 -102c-23 0 -56 14 -72 30l-100 103c-3 3 -7 9 -9 13c-50 -28 -108 -44 -169 -44c-193 0 -350 157 -350 350s157 350 350 350zM350 700
+c-139 0 -250 -111 -250 -250s111 -250 250 -250c62 0 119 23 163 60c7 11 19 25 31 31l3 3c34 43 53 97 53 156c0 139 -111 250 -250 250zM300 600h100v-100h100v-100h-100v-100h-100v100h-100v100h100v100z" />
+    <glyph glyph-name="de" unicode="&#xe0de;" horiz-adv-x="900" 
+d="M350 800c193 0 350 -157 350 -350c0 -61 -17 -119 -44 -169c4 -2 10 -6 13 -9l103 -100c16 -16 30 -49 30 -72c0 -56 -46 -102 -102 -102c-23 0 -56 14 -72 30l-100 103c-3 3 -7 9 -9 13c-50 -28 -108 -44 -169 -44c-193 0 -350 157 -350 350s157 350 350 350zM350 700
+c-139 0 -250 -111 -250 -250s111 -250 250 -250c62 0 119 23 163 60c7 11 19 25 31 31l3 3c34 43 53 97 53 156c0 139 -111 250 -250 250zM200 500h300v-100h-300v100z" />
+  </font>
+</defs></svg>

BIN
EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf


BIN
EVCB_OCPP.WEBAPI/wwwroot/css/open-iconic/font/fonts/open-iconic.woff


BIN
EVCB_OCPP.WEBAPI/wwwroot/favicon.ico


BIN
EVCB_OCPP.WEBAPI/wwwroot/icon-192.png


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно