Program.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Threading.Tasks;
  6. using Microsoft.AspNetCore;
  7. using Microsoft.AspNetCore.Hosting;
  8. using Microsoft.Extensions.Configuration;
  9. using Microsoft.Extensions.Logging;
  10. using Newtonsoft.Json.Linq;
  11. using TEAMModelOS.SDK.Extension.JsonPath;
  12. using TEAMModelOS.SDK.Helper.Common.JsonHelper;
  13. namespace TEAMModelOS.Test.CosmosDB
  14. {
  15. public class Program
  16. {
  17. public static void Main(string[] args)
  18. {
  19. //var map = new List<int>() { 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 2, 0, 0, 2, 2, 2, 2, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 3, 2, 2, 0, 1 };
  20. //var map1 = new List<int>(){ 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 3, 3, 2, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1 };
  21. //var m = new List<List<int>>
  22. //{
  23. // map,
  24. // map1
  25. //};
  26. //var a = m[0].Sum();
  27. //var b = m[1].Sum();
  28. //IHostingEnvironment _hostingEnvironment = ;
  29. // 获取系统路径
  30. string contentRootPath = "";
  31. string identity = "IES/adas";
  32. string query = "$.info";
  33. JObject parsedJson = JObject.Parse(identity);
  34. JsonPathContext context = new JsonPathContext
  35. { ValueSystem = new JsonNetValueSystem() };
  36. List<dynamic> papers = context.SelectNodes(parsedJson,
  37. query).Select(node => node.Value).ToList();
  38. //m.ToJson();
  39. //CreateWebHostBuilder(args).Build().Run();
  40. }
  41. public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
  42. WebHost.CreateDefaultBuilder(args)
  43. .UseStartup<Startup>();
  44. }
  45. }