public void Col_Expression_Column_With_Alias_Name()
        {
            IAlias <Person> person = sql.Alias <Person>("per");
            IColumn         column = person.Col(x => x.Id);

            QueryResult result = engine.Compile(column);

            Assert.Equal("\"per\".\"Id\"", result.Sql);
        }
        public void Col_String_Column()
        {
            IAlias <Person> person = sql.Alias <Person>();
            IColumn         column = person.Col("Id");

            QueryResult result = engine.Compile(column);

            Assert.Equal("\"person\".\"Id\"", result.Sql);
        }
Example #3
0
        public void Col_String_Column_Nested_With_Alias_Name()
        {
            IAlias <Person> person = sql.Alias <Person>("per");
            IColumn         column = person.Col("Address.Street");

            QueryResult result = engine.Compile(column);

            Assert.Equal("\"per\".\"AddressStreet\"", result.Sql);
        }
Example #4
0
        public void Col_Expression_Column_Nested_Deep_With_Alias_Name()
        {
            IAlias <Person2> person = sql.Alias <Person2>("per");
            IColumn          column = person.Col(x => x.Address.City.Country.Name);

            QueryResult result = engine.Compile(column);

            Assert.Equal("\"per\".\"AddressCityCountryName\"", result.Sql);
        }
Example #5
0
        public void Col_String_Column_With_Translation_With_Alias_Name()
        {
            IAlias <Person> person = sql.Alias <Person>("per");
            IColumn         column = person.Col("Created");

            QueryResult result = engine.Compile(column);

            Assert.Equal("\"per\".\"DateCreated\"", result.Sql);
        }
Example #6
0
        public void Col_Expression_Column_With_Translation()
        {
            IAlias <Person> person = sql.Alias <Person>();
            IColumn         column = person.Col(x => x.Created);

            QueryResult result = engine.Compile(column);

            Assert.Equal("\"person\".\"DateCreated\"", result.Sql);
        }
Example #7
0
        public void Col_String_Column_ForeignKey_With_Alias_Name()
        {
            IAlias <Person> person = sql.Alias <Person>("per");
            IColumn         column = person.Col("Department.Id");

            QueryResult result = engine.Compile(column);

            Assert.Equal("\"per\".\"DepartmentId\"", result.Sql);
        }
Example #8
0
        public void Col_Expression_Column_Nested()
        {
            IAlias <Person> person = sql.Alias <Person>();
            IColumn         column = person.Col(x => x.Address.Street);

            QueryResult result = engine.Compile(column);

            Assert.Equal("\"person\".\"AddressStreet\"", result.Sql);
        }
Example #9
0
        public void Col_Expression_Column_ForeignKey()
        {
            IAlias <Person> person = sql.Alias <Person>();
            IColumn         column = person.Col(x => x.Department.Id);

            QueryResult result = engine.Compile(column);

            Assert.Equal("\"person\".\"DepartmentId\"", result.Sql);
        }
Example #10
0
        public void Col_String_Column_Nested_Deep()
        {
            IAlias <Person2> person = sql.Alias <Person2>();
            IColumn          column = person.Col("Address.City.Country.Name");

            QueryResult result = engine.Compile(column);

            Assert.Equal("\"person2\".\"AddressCityCountryName\"", result.Sql);
        }
Example #11
0
        public void Col_All_Columns_With_Alias_Name()
        {
            IAlias  person = sql.Alias("person", "per");
            IColumn column = person.Col("*");

            QueryResult result = engine.Compile(column);

            Assert.Equal("\"per\".*", result.Sql);
        }
Example #12
0
        public void Col_Column()
        {
            IAlias  person = sql.Alias("dbo.person");
            IColumn column = person.Col("Id");

            QueryResult result = engine.Compile(column);

            Assert.Equal("\"dbo\".\"person\".\"Id\"", result.Sql);
        }
        public void Col_String_All_Columns()
        {
            IAlias <Person> person = sql.Alias <Person>();
            IColumn         column = person.Col("*");

            QueryResult result = engine.Compile(column);

            Assert.Equal("\"person\".\"Id\", \"person\".\"Active\", \"person\".\"Name\", \"person\".\"SurName\", "
                         + "\"person\".\"AddressStreet\", \"person\".\"AddressCity\", \"person\".\"Salary\", "
                         + "\"person\".\"DateCreated\", \"person\".\"DepartmentId\", \"person\".\"Image\"", result.Sql);
        }
Example #14
0
        public void Col_Expression_All_With_Alias_Name()
        {
            IAlias <Person> person = sql.Alias <Person>("per");
            IColumn         column = person.Col(x => x);

            QueryResult result = engine.Compile(column);

            Assert.Equal("\"per\".\"Id\", \"per\".\"Active\", \"per\".\"Name\", \"per\".\"SurName\", "
                         + "\"per\".\"AddressStreet\", \"per\".\"AddressNumber\", \"per\".\"AddressCity\", "
                         + "\"per\".\"Salary\", \"per\".\"DateCreated\", \"per\".\"DepartmentId\", \"per\".\"Image\"", result.Sql);
        }