12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- using EVCB_OCPP.Domain;
- using EVCB_OCPP.WSServer.Message;
- using EVCB_OCPP.WSServer.Service;
- using Microsoft.EntityFrameworkCore;
- using Microsoft.Extensions.Configuration;
- using Microsoft.Extensions.DependencyInjection;
- using Microsoft.Extensions.Hosting;
- using Microsoft.Extensions.Logging;
- using Newtonsoft.Json;
- using System;
- using NLog;
- using NLog.Web;
- using NLog.Extensions.Logging;
- using System.IO;
- using System.Data.Common;
- using Microsoft.Data.SqlClient;
- using EVCB_OCPP.WSServer.Helper;
- namespace EVCB_OCPP.WSServer
- {
-
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("====================================================================================================");
- Console.WriteLine("=================" +
- "===================================================================================");
- Console.WriteLine("== ==");
- Console.WriteLine("== ------------ ----------- ------------- ------------- ==");
- Console.WriteLine("== --- --- ---- ---------------- ---------------- ==");
- Console.WriteLine("== --- --- ---- ---- --- ---- --- ==");
- Console.WriteLine("== --- --- ---- ---- --- ---- --- ==");
- Console.WriteLine("== --- --- ---- ---- ------------- ---- ------------- ==");
- Console.WriteLine("== --- --- ---- ---- ----------- ---- ----------- ==");
- Console.WriteLine("== --- --- ---- ---- ---- ==");
- Console.WriteLine("== --- --- ---- ---- ---- ==");
- Console.WriteLine("== ----------- ----------- ---- ---- ==");
- Console.WriteLine("== ==");
- Console.WriteLine("====================================================================================================");
- Console.WriteLine("====================================================================================================");
- //ThreadPool.GetMaxThreads(out var workerThreads, out var completionThreads);
- //ThreadPool.SetMinThreads((int)(workerThreads * 0.8), (int)(completionThreads * 0.8));
- IHost host = Host.CreateDefaultBuilder(args)
- //.UseEnvironment("Development")
- //.ConfigureLogging((context, builder) => {
- // builder.ClearProviders();
- // builder.AddAzureWebAppDiagnostics();
- // NLog.LogManager.Configuration = new NLogLoggingConfiguration(context.Configuration.GetSection("NLog"));
- //})
- //.UseNLog()
- .AddLogServcie()
- .ConfigureServices((hostContext, services) =>
- {
- //services.AddSingleton<MeterValueGroupSingleHandler>();
- services.AddProtalServer(hostContext.Configuration);
- })
- .Build();
- host.Run();
- }
- public static object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
- {
- DateTime? timevalue = null;
- if (reader.Value != null)
- {
- DateTime date = ((DateTime)reader.Value).ToLocalTime();
- timevalue = new DateTime(date.Year, date.Month, date.Day, date.TimeOfDay.Hours, date.TimeOfDay.Minutes, date.TimeOfDay.Seconds, 000);
- }
- return timevalue;
- }
- }
- }
|