Ejemplo n.º 1
0
        public static void CustomerReflect()
        {
            IDataMapper test   = new ReflectDataMapper(typeof(Customer), connStr, true);
            IEnumerable res    = test.GetAll();
            object      id     = test.Insert(insertTestC);
            Customer    actual = (Customer)test.GetById(id);

            test.Delete(actual);
            Customer original = (Customer)test.GetById("ALFKI");

            test.Update(updateTestC);
            test.Update(original);
        }
Ejemplo n.º 2
0
        public static void EmployeeReflect()
        {
            IDataMapper test   = new ReflectDataMapper(typeof(Employee), connStr, true);
            object      id     = test.Insert(tester);
            IEnumerable res    = test.GetAll();
            Employee    actual = (Employee)test.GetById(id);

            test.Delete(actual);
            Employee original = (Employee)test.GetById(1);

            test.Update(tester);
            test.Update(original);
        }
Ejemplo n.º 3
0
        public static void ProductReflect()
        {
            IDataMapper test       = new ReflectDataMapper(typeof(Product), connStr, true);
            IDataMapper categories = new ReflectDataMapper(typeof(Category), connStr, true);
            IDataMapper suppliers  = new ReflectDataMapper(typeof(Supplier), connStr, true);
            IEnumerable res        = test.GetAll();
            Category    c          = (Category)categories.GetById(4);
            Supplier    s          = (Supplier)suppliers.GetById(17);

            object  id     = test.Insert(ProductBuilder(c, s));
            Product actual = (Product)test.GetById(id);

            test.Delete(actual);

            Product original = (Product)test.GetById(10);

            c = (Category)categories.GetById(4);
            s = (Supplier)suppliers.GetById(17);


            test.Update(ProductBuilder(c, s));
            test.Update(original);
        }