예제 #1
0
 private void TestUpdate <T>(DAL.Abstractions.IGenericRepository <T> rep, T entity)
 {
     ChangeColor();
     Console.WriteLine($"Update entity {entity}");
     ReturnColor();
     rep.Update(entity);
     rep.Save();
 }
예제 #2
0
 private void TestInsert <T>(DAL.Abstractions.IGenericRepository <T> rep, T entity)
 {
     ChangeColor();
     Console.WriteLine($"Insert {entity}");
     ReturnColor();
     rep.Insert(entity);
     rep.Save();
 }
예제 #3
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();
        }