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 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)); */ /* var dto = new ResultValueDto(); 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)); //var dto2 = new ResultValueDto(); //bnd.LoadFromStringTo(str, dto2, typeof(ResultValueDto)); */ var config = new StartupConfiguration("BO Console", Assembly.GetExecutingAssembly().GetName().Version); 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(); } } }