-
-
Notifications
You must be signed in to change notification settings - Fork 91
feat: Upgrade major mongo version #418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -22,7 +22,7 @@ ValueTask<IPagedList<TEntity>> GetAllAsync( | |||||
| int pageSize = int.MaxValue); | ||||||
|
|
||||||
| ValueTask<IPagedList<TProjection>> GetAllByProjectionAsync<TProjection>( | ||||||
| Expression<Func<TEntity, TProjection>>? selector, | ||||||
| Expression<Func<TEntity, TProjection>> selector, | ||||||
|
||||||
| Expression<Func<TEntity, TProjection>> selector, | |
| Expression<Func<TEntity, TProjection>> selector, // Must not be null |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Linq.Expressions; | ||
| using System.Threading.Tasks; | ||
| using LinkDotNet.Blog.Domain; | ||
|
|
@@ -51,7 +52,7 @@ public async ValueTask<IPagedList<TEntity>> GetAllAsync(Expression<Func<TEntity, | |
| await GetAllByProjectionAsync(s => s, filter, orderBy, descending, page, pageSize); | ||
|
|
||
| public async ValueTask<IPagedList<TProjection>> GetAllByProjectionAsync<TProjection>( | ||
| Expression<Func<TEntity, TProjection>>? selector, | ||
| Expression<Func<TEntity, TProjection>> selector, | ||
|
||
| Expression<Func<TEntity, bool>>? filter = null, | ||
| Expression<Func<TEntity, object>>? orderBy = null, | ||
| bool descending = true, | ||
|
|
@@ -70,8 +71,9 @@ public async ValueTask<IPagedList<TProjection>> GetAllByProjectionAsync<TProject | |
| query = descending ? query.OrderByDescending(orderBy) : query.OrderBy(orderBy); | ||
| } | ||
|
|
||
| var projectionQuery = query.Select(selector); | ||
| return await projectionQuery.ToPagedListAsync(page, pageSize); | ||
| return await query | ||
| .Select(selector) | ||
| .ToPagedListAsync(page, pageSize); | ||
| } | ||
|
|
||
| public async ValueTask StoreAsync(TEntity entity) | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -47,7 +47,7 @@ public ValueTask<IPagedList<TEntity>> GetAllAsync(Expression<Func<TEntity, bool> | |||||
| GetAllByProjectionAsync(s => s, filter, orderBy, descending, page, pageSize); | ||||||
|
||||||
| GetAllByProjectionAsync(s => s, filter, orderBy, descending, page, pageSize); | |
| GetAllByProjectionAsync(selector: s => s, filter, orderBy, descending, page, pageSize); |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -50,7 +50,7 @@ public ValueTask<IPagedList<TEntity>> GetAllAsync(Expression<Func<TEntity, bool> | |||||||||||||
| GetAllByProjectionAsync(s => s, filter, orderBy, descending, page, pageSize); | ||||||||||||||
|
|
||||||||||||||
|
||||||||||||||
| /// <summary> | |
| /// Retrieves a paginated list of entities projected to a specific type. | |
| /// The selector parameter must not be null. | |
| /// </summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updated non-nullable selector parameter mandates that a projection must always be provided; verify that cached calls conform to this requirement.