public void Expression_Method_ForeignKey(object value) { Person person = null; IOperator op = sql.Op(() => SqlExp.NotEq(person.Department.Id, value)); QueryResult result = engine.Compile(op); Assert.Equal("\"person\".\"DepartmentId\" <> @p0", result.Sql); Assert.Equal(new Dictionary <string, object> { ["@p0"] = value }, result.Parameters); }
public void Expression_Method_Nested(object value) { Person person = null; IOperator op = sql.Op(() => SqlExp.NotEq(person.Address.Street, value)); QueryResult result = engine.Compile(op); Assert.Equal("\"person\".\"AddressStreet\" <> @p0", result.Sql); Assert.Equal(new Dictionary <string, object> { ["@p0"] = value }, result.Parameters); }
public void Expression_Method_Inline_Value() { Person person = null; IOperator op = sql.Op(() => SqlExp.NotEq(person.Id, 1)); QueryResult result = engine.Compile(op); Assert.Equal("\"person\".\"Id\" <> @p0", result.Sql); Assert.Equal(new Dictionary <string, object> { ["@p0"] = 1 }, result.Parameters); }
public void Expression_Method_List_Inline_Value() { Department dept = null; IOperator op = sql.Op(() => SqlExp.NotEq(dept.Tags, new List <string> { "abcd", "efgh", "ijkl" })); QueryResult result = engine.Compile(op); Assert.Equal("\"dept\".\"Tags\" <> @p0", result.Sql); Assert.Equal(new Dictionary <string, object> { ["@p0"] = new List <string> { "abcd", "efgh", "ijkl" } }, result.Parameters); }