示例#1
0
        public void Test1()
        {
            var command = new CustomSqlCommand("DBContext");

            var testInt = 5;
            var plane   = new Plane {
                PlaneAge = 10
            };
            var query = command.Select(typeof(Plane), typeof(Tickets))
                        .From(typeof(Plane))
                        .Join <Plane, Tickets>((x, y) => (plane.PlaneAge + testInt) < y.Price).ToString();
        }
示例#2
0
        public void Test2()
        {
            var command = new CustomSqlCommand("DBContext");

            var list = new List <int> {
                8, 9, 10
            };

            command.Select(typeof(Plane))
            .From(typeof(Plane))
            .Where <Plane>(x => x.PlaneAge == list.Count()).ToString();
        }
示例#3
0
        public void SimpleQueryTest()
        {
            var command = new CustomSqlCommand("DBContext");

            var query = command.Select(typeof(Plane), typeof(Tickets))
                        .From(typeof(Plane))
                        .Join <Plane, Tickets>((x, y) => x.Id == y.PlaneId)
                        .Where <Plane>(x => x.Id == 2);

            var stringQuery = query.ToString();

            var passengers = query.ExecuteCommand <AirCompany>().ToList().Count();
        }