Skip to content

Commit 559d28d

Browse files
committed
no message
1 parent b75caae commit 559d28d

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

SubSonic.Core.DataAccessLayer/src/Linq/Extensions/SubSonicQueryable/QueryableExtensions.cs

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,40 @@ public static List<TSource> ToList<TSource>(this IQueryable<TSource> source)
6565
}
6666

6767
/// <summary>
68-
///
68+
/// Load data from the database
6969
/// </summary>
7070
/// <typeparam name="TEntity"></typeparam>
71-
/// <param name="query"></param>
72-
/// <returns></returns>
71+
/// <param name="query"><see cref="IQueryable{T}"/></param>
72+
/// <returns>returns the data in a <see cref="ISubSonicCollection{TEntity}"/></returns>
7373
public static IQueryable<TEntity> Load<TEntity>(this IQueryable<TEntity> query)
7474
{
7575
if (query is null)
7676
{
7777
throw new ArgumentNullException(nameof(query));
7878
}
7979

80+
return query.Load(false);
81+
}
82+
83+
/// <summary>
84+
/// Load data from the database
85+
/// </summary>
86+
/// <typeparam name="TEntity"></typeparam>
87+
/// <param name="query"><see cref="IQueryable{T}"/></param>
88+
/// <param name="refresh">if true, clear the collection so the collection can be refreshed from the database.</param>
89+
/// <returns>returns the data in a <see cref="ISubSonicCollection{TEntity}"/></returns>
90+
public static IQueryable<TEntity> Load<TEntity>(this IQueryable<TEntity> query, bool refresh)
91+
{
92+
if (query is null)
93+
{
94+
throw new ArgumentNullException(nameof(query));
95+
}
96+
97+
if (refresh)
98+
{
99+
throw Error.NotImplemented();
100+
}
101+
80102
return query.Provider.Execute<IQueryable<TEntity>>(query.Expression);
81103
}
82104

0 commit comments

Comments
 (0)