Hi,
I'm running SubSonic against a MySQL db, and having some trouble with the querying code.
1. Given this query:
Query qry = Category.CreateQuery().WHERE("ParentCategoryID", DBNull.Value);
qry.GetSql() returns "SELECT * FROM `category`;"
which is incorrect. I also get zero rows - it should be many rows... given the GetSQL() output, I should actually be getting all rows.
2. Given this query:
Query qry = new Query(Category.Schema).WHERE("ParentCategoryID is null");
I get:
[FormatException: Input string was not in a correct format.]
3. So then I tried this:
SqlQuery qry = new Select("CategoryID", "CategoryName").From("Category").Where("ParentCategoryID").IsNull();
which gave me:
[SqlQueryException: Need to have at least one From table specified]
4. Finally, I tried this:
SqlQuery qry = new Select("CategoryID", "CategoryName")
.From(Category.Schema)
.Where(Category.ParentCategoryIDColumn).IsNull();
... which worked fine.
The first 3 look like bugs to me.