예제 #1
0
        /// <summary>Implements the show case.</summary>
        public static void Show()
        {
            Console.WriteLine("(Q2) Query demonstration");
            Console.WriteLine("------------------------");

            Console.WriteLine("Teacher 't.0':");
            Teacher t = Orm.Get <Teacher>("t.0");

            Console.WriteLine(t.FirstName + " " + t.Name);

            Person p = new Person();

            p.ID        = "p.0";
            p.FirstName = "Alex";
            p.Name      = "Lang";
            p.BirthDate = new DateTime(1972, 3, 28);
            p.Gender    = Gender.MALE;
            Orm.Save(p);

            Console.WriteLine("\nStudents with grade > 2:");
            foreach (Student i in Orm.From <Student>().GreaterThan("Grade", 2))
            {
                Console.WriteLine(i.FirstName + " " + i.Name);
            }

            Console.WriteLine("\nShow all persons:");
            foreach (Person i in Orm.From <Person>())
            {
                Console.WriteLine(i.FirstName + " " + i.Name + " (" + i.GetType().Name + ")");
            }
        }
예제 #2
0
        /// <summary>Implements the show case.</summary>
        public static void Show()
        {
            Console.WriteLine("(Q1) Query demonstration");
            Console.WriteLine("------------------------");

            Console.WriteLine("Teacher 't.0':");
            Teacher t = Orm.Get <Teacher>("t.0");

            Console.WriteLine(t.FirstName + " " + t.Name);

            Console.WriteLine("\nStudents with grade > 2:");
            foreach (Student i in Orm.From <Student>().GreaterThan("Grade", 2))
            {
                Console.WriteLine(i.FirstName + " " + i.Name);
            }

            Console.WriteLine("\nShow all persons:");
            foreach (Person i in Orm.From <Person>())
            {
                Console.WriteLine(i.FirstName + " " + i.Name + " (" + i.GetType().Name + ")");
            }
        }
예제 #3
0
        /// <summary>Implements the show case.</summary>
        public static void Show()
        {
            Console.WriteLine("(7) Query demonstration");
            Console.WriteLine("-----------------------");

            Console.WriteLine("Students with grade > 1:");
            foreach (Student i in Orm.From <Student>().GreaterThan("Grade", 1))
            {
                Console.WriteLine(i.FirstName + " " + i.Name);
            }

            Console.WriteLine("\nStudents with grade > 1 or firstname starts with 'al':");
            foreach (Student i in Orm.From <Student>().GreaterThan("Grade", 1).Or().Like("FirstName", "al%", true))
            {
                Console.WriteLine(i.FirstName + " " + i.Name);
            }

            Console.WriteLine("\nShow all persons:");
            foreach (Person i in Orm.From <Person>())
            {
                Console.WriteLine(i.FirstName + " " + i.Name + " (" + i.GetType().Name + ")");
            }
        }