I'm getting my head back into SubSonic on a project with v2.1 fairly embedded (meaning we won't be switching it to v3).
I'm ripping through a bunch of method parameters to build a long, but not overly complex, query. At the tail end of this query, I need to add a statement that adds a group of OR statements, something to the equivalent of:
...AND ((DateColumn BETWEEN @StartDate1 AND @EndDate1) OR (DateColumn BETWEEN StartDate2 AND @EndDate2))
Right now I have:
if (criteria.TaxCreditApprovalYear != null && criteria.TaxCreditApprovalYear.Count > 0)
{
criteria.TaxCreditApprovalYear.ForEach(year => qry.And(Property_Overview.Columns.EffectiveDate)
.IsBetweenAnd(new DateTime(year, 01, 01),
new DateTime(year, 12, 31)));
}
which is giving me a bunch of AND statements. I know that an Or or OrExpression needs to make it's way in there, but I haven't been able to track down where or how to drop that in.
Any thoughts? I'm open to pretty much anything that gets me an appropriate query that doesn't override the other existing AND statements that may or may not already exist.