-
-
Notifications
You must be signed in to change notification settings - Fork 79
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, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By removing the nullable annotation, the repository interface now requires a non-null selector; ensure that implementations and consumers are consistent with this change.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
Expression<Func<TEntity, bool>>? filter = null, | ||||||
Expression<Func<TEntity, object>>? orderBy = null, | ||||||
bool descending = true, | ||||||
|
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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The change to a non-nullable selector enforces that a valid projection is always provided; confirm that downstream callers are updated accordingly. Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
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); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The selector parameter is now required; update any RavenDB repository calls to supply a non-null expression.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
|
||||||
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, | ||||||
|
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); | ||||||||||||||
|
||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The selector parameter is now non-nullable; ensure that all consumers of this repository pass a valid non-null selector expression.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||
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, | ||||||||||||||
|
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.
Copilot uses AI. Check for mistakes.