SubSonic-3.0 icon indicating copy to clipboard operation
SubSonic-3.0 copied to clipboard

Add Dynamic Linq Library to SubSonic

Open jpturski opened this issue 14 years ago • 0 comments

In syntax of SubSonic 2 i can this:

SqlQuery query = new Select().From<Table>() .Where(col).Like(string.Format("%{0}%", val)) .OrderDesc(col);

where "col" and "val" are strings...

But in SubSonic 3 using Linq syntax it's not possible because Linq is type-safe. But has situations where is nedeed make queries dynamically.

I found the library DynamicLinq (DynamicQueryable) and this make possible queryes about this:

Table.All().Where(string.Format("{0}.Contains("{1}")", col, val)).OrderBy(col);

Its is not a good idea for next versions?

jpturski avatar Apr 11 '10 16:04 jpturski