Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 42eeae7

Browse files
committed
Merge pull request #285 from MarkWalls/patch-2
Question if this kind of predicate is acceptable in extensions?
2 parents 97e1c05 + a930adf commit 42eeae7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ServiceStack.OrmLite/OrmLiteReadConnectionExtensions.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ public static List<T> Where<T>(this IDbConnection dbConn, object anonType)
140140
return dbConn.Exec(dbCmd => dbCmd.Where<T>(anonType));
141141
}
142142

143+
public static List<T> Where<T>(this IDbConnection dbConn, System.Linq.Expressions.Expression<Func<T,bool>> Predicate)
144+
{
145+
return (List<T>) dbConn.Select<T>(Predicate);
146+
}
147+
143148
public static List<T> Query<T>(this IDbConnection dbConn, string sql)
144149
{
145150
return dbConn.Exec(dbCmd => dbCmd.Query<T>(sql));
@@ -355,4 +360,4 @@ public static long GetLongScalar(this IDbConnection dbConn)
355360
return dbConn.Exec(dbCmd => dbCmd.GetLongScalar());
356361
}
357362
}
358-
}
363+
}

0 commit comments

Comments
 (0)