Skip to content
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

Vs internal issue #5807 #21989

Merged
merged 8 commits into from
Jan 28, 2025
Merged

Vs internal issue #5807 #21989

merged 8 commits into from
Jan 28, 2025

Conversation

MansurBesleney
Copy link
Contributor

Added Id field to be able to filter users by there Id's too.

Resolves vs-internal issue #5807

  • Added Guid? Id field to IIdeintityRepository's GetListAsync and GetCountAsync methods.
  • Added Guid? Id field to GetListAsync and GetCountAsync method implementations in EfCoreIdentityUserRepository and MongoIdentityUserRepository.
  • Added Guid? Id field and its where clause to filter query on GetFilteredQueryableAsync method both in EfCoreIdentityUserRepository and MongoIdentityUserRepository.

Checklist

  • I fully tested it as developer.
  • No need to document.

How to test it?

You can test it at ABP Admin -> Identity Management-> Users pages filter section.

image

image

@@ -482,6 +487,7 @@ protected virtual async Task<IQueryable<IdentityUser>> GetFilteredQueryableAsync
.WhereIf(maxCreationTime != null, p => p.CreationTime <= maxCreationTime)
.WhereIf(minCreationTime != null, p => p.CreationTime >= minCreationTime)
.WhereIf(maxModifitionTime != null, p => p.LastModificationTime <= maxModifitionTime)
.WhereIf(minModifitionTime != null, p => p.LastModificationTime >= minModifitionTime);
.WhereIf(minModifitionTime != null, p => p.LastModificationTime >= minModifitionTime)
.WhereIf(id.HasValue, x => x.Id == id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If id.HasValue, we can ignore other filters. also same for MongoIdentityUserRepository

if(id.HasValue)
{
   return query.Where(x => x.Id == id);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the enhancment you mentioned.

Comment on lines 467 to 471
if (id.HasValue)
{
return query.Where(x => x.Id == id);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move to after var query = await GetQueryableAsync();

It has priority over roleId.

@MansurBesleney MansurBesleney marked this pull request as ready for review January 24, 2025 08:49
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 77.77778% with 8 lines in your changes missing coverage. Please review.

Project coverage is 52.00%. Comparing base (4284e0b) to head (c1d23fb).
Report is 225 commits behind head on dev.

Files with missing lines Patch % Lines
...bp/Identity/MongoDB/MongoIdentityUserRepository.cs 28.57% 3 Missing and 2 partials ⚠️
...ntityFrameworkCore/EfCoreIdentityUserRepository.cs 89.65% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #21989      +/-   ##
==========================================
+ Coverage   51.97%   52.00%   +0.03%     
==========================================
  Files        3181     3183       +2     
  Lines      102210   102334     +124     
  Branches     7741     7772      +31     
==========================================
+ Hits        53121    53219      +98     
- Misses      47450    47466      +16     
- Partials     1639     1649      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@oykuermann oykuermann merged commit a174560 into dev Jan 28, 2025
6 checks passed
@oykuermann oykuermann deleted the vs-internal-issue-#5807 branch January 28, 2025 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants