Esempio n. 1
0
 private void TestDelete <T>(DAL.Abstractions.IGenericRepository <T> rep, T entity)
 {
     ChangeColor();
     Console.WriteLine($"Delete {entity}");
     ReturnColor();
     rep.Delete(entity);
     rep.Save();
 }
Esempio n. 2
0
        private void TestDeleteById <T>(DAL.Abstractions.IGenericRepository <T> rep)
        {
            ChangeColor();
            int rand = random.Next(rep.Get().Count()) + 1;

            Console.WriteLine($"Test DeleteById(id) id={rand}");
            Console.WriteLine(rep.GetById(rand));
            rep.Delete(rand);
            rep.Save();
            ReturnColor();
        }