| 12345678910111213141516171819202122232425262728293031323334353637 |
- // See https://aka.ms/new-console-template for more information
- using System.Reflection;
- using Quadarax.Foundation.Core.Console;
- using Quadarax.Foundation.Core.QConsole;
- using Quadarax.Foundation.Core.QConsole.Configuration;
- using Quadarax.Foundation.Core.QConsole.Context;
- using Quadarax.Foundation.Core.Reflection.Extensions;
- /*
- var options = new DbContextOptions<QlbrcDbContext>();
- using (var ctx = new QlbrcDbContext(options))
- {
- var result = ctx.Database.EnsureCreated();
- Console.WriteLine($"Database created: {result}");
- }
- */
- var config = new StartupConfiguration(Quadarax.Application.QLiberace.Console.Constants.General.Name, Assembly.GetExecutingAssembly().GetName().Version);
- config.ConsoleCopyright = Assembly.GetExecutingAssembly().GetCopyright();
- config.AllowInteractive = false;
- config.WaitOnKeyInNonInteractiveMode = false;
- config.CommandDefinitionAssebmly = new[]{Assembly.GetEntryAssembly()};
- config.DisableDefaultCommands();
- config.ShowStatusOnEveryCommand = false;
- config.IsConsoleDebug = false;
- var console = new Engine(config, new DefualtEngineContext(), args);
- console.Start();
- using (var writer = new ConsoleWriter(console.ReturnCode == 0 ? ConsoleColor.DarkGreen : console.ReturnCode < 9 ? ConsoleColor.DarkYellow : ConsoleColor.DarkRed))
- writer.WriteLine($"Exiting with return code {console.ReturnCode}");
- Environment.Exit(console.ReturnCode);
|