private static void DeleteCreditRisk(CreditRisk risk)
 {
     using (var repo = new CreditRiskRepo())
     {
         try
         {
             repo.Delete(risk);
         }
         catch (Exception ex)
         {
             WriteLine(ex);
         }
     }
 }
Ejemplo n.º 2
0
        private static void PrintAllCustomersCreditRisks()
        {
            ForegroundColor = ConsoleColor.DarkYellow;

            WriteLine("-> Customers");
            using (var repo = new CustomerRepo())
                foreach (var cust in repo.GetAll())
                {
                    WriteLine($"{cust.FirstName} {cust.LastName} is a Customer.");
                }

            WriteLine("-> CreditRisks");
            using (var repo = new CreditRiskRepo())
                foreach (var cust in repo.GetAll())
                {
                    WriteLine($"{cust.FirstName} {cust.LastName} is a Credit Risk!");
                }
        }
 private static void PrintAllCustomersAndCreditRisks()
 {
     WriteLine("*********** Customers ***********");
     using (var repo = new CustomerRepo())
     {
         foreach (var cust in repo.GetAll())
         {
             WriteLine($"-> {cust.FirstName} {cust.LastName} is a Customer.");
         }
     }
     WriteLine("*********** Credit Risks ***********");
     using (var repo = new CreditRiskRepo())
     {
         foreach (var risk in repo.GetAll())
         {
             WriteLine($"-> {risk.FirstName} {risk.LastName} is a Credit Risk!");
         }
     }
 }