Exemplo n.º 1
0
 public void Restart(AppInfo info)
 {
     lock (this) {
         StartApp removed = null;
         if (Apps.TryRemove(info.Name, out removed))
         {
             removed.Dispose();
         }
         var app = new StartApp(info.Name, _shell, new AppConfig()
         {
             EnvVariables = new Dictionary <string, string>()
             {
                 { "PORT", info.Port.ToString() }
             }
         }, HandleLogMessage(info.Name));
         Apps.TryAdd(info.Name, app);
     }
 }
Exemplo n.º 2
0
        static void Main()
        {
            using var ctx = new Project0Context();
            var current = HaveYouBeenHereBefore();

            Console.WriteLine($"Weclome {current.FirstName}");
            var start = new StartApp();

            start.MainMenu();
            var    OrderMain = new OrderHelp();
            string mainOrder = OrderMain.CustomerOrder();

            var customerTotal = ctx.Product.FirstOrDefault(m => m.ProductName == mainOrder);


            var order = new CustomerOrder
            {
                StoreId    = 2,
                OrderDate  = DateTime.Now.Date,
                Total      = customerTotal.Price,
                CustomerId = current.Id,
            };

            ctx.Add(order);
            try
            {
                ctx.SaveChanges();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            finally
            {
                Console.WriteLine("Your order is added.");
            }
        }
 static void Main(string[] args)
 {
     StartApp.Start();
 }