Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Synchronous Approach");
            Console.WriteLine("Monthly expenses management system!");

            try
            {
                _expContext = new MEMCore.Data.ExpenseContext();

                //*This approach applicable if you have database context available*//
                _expContext.GetService <ILoggerFactory>().AddProvider(new Data.MEMLoggerProvider());
                _expContext.Database.Migrate();
                var o = GetExpenses();
                //EditExpense(1);
                //Test methods from main
                //NewExpense();
                //NewExpenseWithoutDetails();
                //DeleteExpense(4);
            }
            catch (Exception ex)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(ex.Message);
                Console.ResetColor();
            }
            Console.WriteLine("Press any key to close.."); Console.ReadKey();
        }