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

Commit 148d5a6

Browse files
committed
Change include in LoadSelect to string[] to match async versions, leave IEnumerable overload for compat with AQ
1 parent 707968d commit 148d5a6

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

src/ServiceStack.OrmLite/OrmLiteReadExpressionsApi.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public static long RowCount(this IDbConnection dbConn, string sql)
247247
/// Returns results with references from using a LINQ Expression. E.g:
248248
/// <para>db.LoadSelect&lt;Person&gt;(x =&gt; x.Age &gt; 40)</para>
249249
/// </summary>
250-
public static List<T> LoadSelect<T>(this IDbConnection dbConn, Expression<Func<T, bool>> predicate, IEnumerable<string> include = null)
250+
public static List<T> LoadSelect<T>(this IDbConnection dbConn, Expression<Func<T, bool>> predicate, string[] include = null)
251251
{
252252
return dbConn.Exec(dbCmd => dbCmd.LoadSelect(predicate, include));
253253
}
@@ -265,7 +265,16 @@ public static List<T> LoadSelect<T>(this IDbConnection dbConn, Expression<Func<T
265265
/// Returns results with references from using an SqlExpression lambda. E.g:
266266
/// <para>db.LoadSelect(db.From&lt;Person&gt;().Where(x =&gt; x.Age &gt; 40))</para>
267267
/// </summary>
268-
public static List<T> LoadSelect<T>(this IDbConnection dbConn, SqlExpression<T> expression = null, IEnumerable<string> include = null)
268+
public static List<T> LoadSelect<T>(this IDbConnection dbConn, SqlExpression<T> expression = null, string[] include = null)
269+
{
270+
return dbConn.Exec(dbCmd => dbCmd.LoadSelect(expression, include));
271+
}
272+
273+
/// <summary>
274+
/// Returns results with references from using an SqlExpression lambda. E.g:
275+
/// <para>db.LoadSelect(db.From&lt;Person&gt;().Where(x =&gt; x.Age &gt; 40), include:q.OnlyFields)</para>
276+
/// </summary>
277+
public static List<T> LoadSelect<T>(this IDbConnection dbConn, SqlExpression<T> expression, IEnumerable<string> include)
269278
{
270279
return dbConn.Exec(dbCmd => dbCmd.LoadSelect(expression, include));
271280
}
@@ -282,7 +291,15 @@ public static List<T> LoadSelect<T>(this IDbConnection dbConn, SqlExpression<T>
282291
/// <summary>
283292
/// Project results with references from a number of joined tables into a different model
284293
/// </summary>
285-
public static List<Into> LoadSelect<Into, From>(this IDbConnection dbConn, SqlExpression<From> expression, IEnumerable<string> include = null)
294+
public static List<Into> LoadSelect<Into, From>(this IDbConnection dbConn, SqlExpression<From> expression, string[] include = null)
295+
{
296+
return dbConn.Exec(dbCmd => dbCmd.LoadSelect<Into, From>(expression, include));
297+
}
298+
299+
/// <summary>
300+
/// Project results with references from a number of joined tables into a different model
301+
/// </summary>
302+
public static List<Into> LoadSelect<Into, From>(this IDbConnection dbConn, SqlExpression<From> expression, IEnumerable<string> include)
286303
{
287304
return dbConn.Exec(dbCmd => dbCmd.LoadSelect<Into, From>(expression, include));
288305
}

0 commit comments

Comments
 (0)