I know this is probably more my lack of knowledge of dotnet than something about OrmLite, but I have a number of table based operations that I’d like to abstract and they look something like this:
var cntSomethingFortheDay = Db.Scalar<SomeClass, int>(x => Sql.Count(x.SomeProperty), x => x.SomeDate >= DateTime.Now.AddDays(-1) && x.SomeDate <= DateTime.Now);
I know how to use generics to pass in an arbitrary “SomeClass”, but is it possible to pass in “SomeProperty” and “SomeDate” as well? (In this case, different classes have different date properties. I’d prefer not to implement interfaces if not necessary). As an alternative, I could also pass in the filter expression itself, but I do know how to craft a stand alone expression outside of the orm lite methods.