Exemplo n.º 1
0
 public void ServiceInfo()
 {
     _logger.Normal($"{new string('-', 15)}Service Information {new string('-', 15)}");
     _logger.Info($"OData Service Url: {odataConnectionString.ServiceUrl} ");
     _logger.Info($"OData Service Version: {O2PGen.MetaDataVersion} ");
     _logger.Info($"Number of Entities: {O2PGen.ClassList.Count}");
     _logger.Normal(new string('-', 50));
     _logger.Sucess("Success creation of the Poco Model");
 }
Exemplo n.º 2
0
        public static async Task Main1(string[] args)
        {
            var argument = string.Join(" ", args);

            try
            {
                _pocoFileSystem = new PocoFileSystem();
                if (!(Console.IsOutputRedirected || Console.IsErrorRedirected))
                {
                    Console.BufferHeight = Int16.MaxValue - 1;
                }

                // Catch all unhandled exceptions in all threads.
                AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
                Sw.Start();
                RetCode = await RunOptionsAsync(args);

                Sw.Stop();
                Console.WriteLine();
                if (!ArgumentParser.ShowVersionOrHelp)
                {
                    Logger.Sucess($"Total processing time: {Sw.ElapsedMilliseconds / 1000.0} sec");
                }
            }
            catch (Exception ex)
            {
                RetCode = (int)ExitCodes.HandledException;
                Logger.Error($"Error in executing the command: o2pgen {argument}");
                Logger.Error($"Error Message:\n {ex.FullExceptionMessage()}");

#if DEBUG
                Logger.Error("--------------------Exception Details---------------------");
                Logger.Error($"Error Message:\n {ex.FullExceptionMessage(true)}");
                Console.ReadKey();
#endif
            }
            finally
            {
                if (!ArgumentParser.ShowVersionOrHelp)
                {
                    Logger.Info($"Application Exit code: {RetCode}");
                }
                Environment.Exit(RetCode);
            }
        }