Program.cs 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using System.IO.Abstractions;
  2. using System.Reflection;
  3. using BO.AppServer.Metadata.Dto;
  4. using Quadarax.Foundation.Core.Data.Interface.Entity.Dto;
  5. using Quadarax.Foundation.Core.Json;
  6. using Quadarax.Foundation.Core.Object.Extensions;
  7. using Quadarax.Foundation.Core.QConsole;
  8. using Quadarax.Foundation.Core.QConsole.Configuration;
  9. using Quadarax.Foundation.Core.QConsole.Context;
  10. using Quadarax.Foundation.Core.Reflection.Extensions;
  11. using Binder = Quadarax.Foundation.Core.Json.Binder;
  12. namespace BO.Console
  13. {
  14. class Program
  15. {
  16. static void Main(string[] args)
  17. {
  18. /*
  19. var str = new StructureRDto();
  20. var x = str.GetAllPropertyValues();
  21. int a = 0;
  22. */
  23. /*
  24. document_add -arts:doc1_file1.bin;doc1_file2.bin -force -user:test -dbg -dump
  25. var user = new UserCDto()
  26. {
  27. Name = "foo",
  28. Email = "fii",
  29. LangLcid = 123,
  30. Password = "frr",
  31. Roles = new[] { "So", "Fa" }
  32. };
  33. var _binder = new Binder(new FileSystem());
  34. _binder.SerializerOptions.IgnoreReadOnlyProperties = true;
  35. _binder.SerializerOptions.IgnoreNullValues = true;
  36. var res = _binder.SaveToString(user);
  37. */
  38. /*
  39. var content = "{\"value\":null,\"isSuccess\":false,\"errors\":[{\"message\":\"User 'Console' has no permission to login in. Access denied!\",\"code\":1200}]}";
  40. //var content = "{\"isSuccess\":false,\"values\":[{\"message\":\"User 'Console' has no permission to login in. Access denied!\",\"code\":1200}]}";
  41. var _binder = new Binder(new FileSystem());
  42. _binder.SerializerOptions.IgnoreReadOnlyProperties = true;
  43. _binder.SerializerOptions.IgnoreNullValues = true;
  44. var res = _binder.LoadFromString(content, typeof(ResultValueDto<UserRDto>));
  45. */
  46. /*
  47. var dto = new ResultValueDto<AuthDto>();
  48. dto.Value.Ticket = "foo";
  49. var bnd = new Binder(new FileSystem());
  50. //bnd.SerializerOptions.IgnoreReadOnlyProperties = true;
  51. var str = bnd.SaveToString(dto);
  52. var dto2 = bnd.LoadFromString(str, typeof(ResultValueDto<AuthDto>));
  53. //var dto2 = new ResultValueDto<AuthDto>();
  54. //bnd.LoadFromStringTo(str, dto2, typeof(ResultValueDto<AuthDto>));
  55. */
  56. var config = new StartupConfiguration("BO Console", Assembly.GetExecutingAssembly().GetName().Version);
  57. config.ConsoleCopyright = Assembly.GetExecutingAssembly().GetCopyright();
  58. config.AllowInteractive = false;
  59. config.WaitOnKeyInNonInteractiveMode = false;
  60. config.CommandDefinitionAssebmly = new Assembly[]{Assembly.GetEntryAssembly()};
  61. config.DisableDefaultCommands();
  62. config.ShowStatusOnEveryCommand = false;
  63. config.IsConsoleDebug = false;
  64. var console = new Engine(config, new DefualtEngineContext(), args);
  65. console.Start();
  66. }
  67. }
  68. }