| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- using System.IO.Abstractions;
- using System.Reflection;
- using BO.AppServer.Metadata.Dto;
- using Quadarax.Foundation.Core.Data.Interface.Entity.Dto;
- using Quadarax.Foundation.Core.Json;
- using Quadarax.Foundation.Core.QConsole;
- using Quadarax.Foundation.Core.QConsole.Configuration;
- using Quadarax.Foundation.Core.QConsole.Context;
- using Quadarax.Foundation.Core.Reflection.Extensions;
- using Binder = Quadarax.Foundation.Core.Json.Binder;
- namespace BO.Console
- {
- class Program
- {
- static void Main(string[] args)
- {
- /*
- var user = new UserCDto()
- {
- Name = "foo",
- Email = "fii",
- LangLcid = 123,
- Password = "frr",
- Roles = new[] { "So", "Fa" }
- };
- var _binder = new Binder(new FileSystem());
- _binder.SerializerOptions.IgnoreReadOnlyProperties = true;
- _binder.SerializerOptions.IgnoreNullValues = true;
- var res = _binder.SaveToString(user);
- */
- /*
- var content = "{\"value\":null,\"isSuccess\":false,\"errors\":[{\"message\":\"User 'Console' has no permission to login in. Access denied!\",\"code\":1200}]}";
- //var content = "{\"isSuccess\":false,\"values\":[{\"message\":\"User 'Console' has no permission to login in. Access denied!\",\"code\":1200}]}";
- var _binder = new Binder(new FileSystem());
- _binder.SerializerOptions.IgnoreReadOnlyProperties = true;
- _binder.SerializerOptions.IgnoreNullValues = true;
- var res = _binder.LoadFromString(content, typeof(ResultValueDto<UserRDto>));
- */
- /*
- var dto = new ResultValueDto<AuthDto>();
- dto.Value.Ticket = "foo";
- var bnd = new Binder(new FileSystem());
- //bnd.SerializerOptions.IgnoreReadOnlyProperties = true;
- var str = bnd.SaveToString(dto);
- var dto2 = bnd.LoadFromString(str, typeof(ResultValueDto<AuthDto>));
- //var dto2 = new ResultValueDto<AuthDto>();
- //bnd.LoadFromStringTo(str, dto2, typeof(ResultValueDto<AuthDto>));
- */
- var config = new StartupConfiguration("BO Console", Assembly.GetExecutingAssembly().GetName().Version);
- config.ConsoleCopyright = Assembly.GetExecutingAssembly().GetCopyright();
- config.AllowInteractive = false;
- config.WaitOnKeyInNonInteractiveMode = false;
- config.CommandDefinitionAssebmly = new Assembly[]{Assembly.GetEntryAssembly()};
- config.DisableDefaultCommands();
- config.ShowStatusOnEveryCommand = false;
- config.IsConsoleDebug = false;
- var console = new Engine(config, new DefualtEngineContext(), args);
- console.Start();
- }
- }
- }
|