Example #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();
        }
 public CurrencyRepository()
 {
     _expContext = new MEMCore.Data.ExpenseContext();
 }
Example #3
0
 public CategoryRepository()
 {
     _expContext = new MEMCore.Data.ExpenseContext();
 }
Example #4
0
 public ExpenseRepository()
 {
     _expContext = new MEMCore.Data.ExpenseContext();
     _expContext.Database.Migrate(); //DK: Need to change this
 }