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

Improve MongoDbCoreRepositoryExtensions #7879

Merged
merged 4 commits into from Mar 1, 2021

Conversation

PMExtra
Copy link
Contributor

@PMExtra PMExtra commented Mar 1, 2021

As same as #5697


return mongoDbRepository;
if (repository is IMongoDbRepository<TEntity> mongoDbRepository) return mongoDbRepository;
throw new ArgumentException("Given repository does not implement " + typeof(IMongoDbRepository<TEntity>).AssemblyQualifiedName, nameof(repository));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just making it more readable and not change any logic.

{
return repository.ToMongoDbRepository().GetAggregateAsync(cancellationToken);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a recursive call because the IMongoDbRepository does not have the GetAggregateAsync method.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I tested the code with 4.2.1 library so I missed the new feature. I will rollback it.

@realLiangshiwei realLiangshiwei merged commit 02e2ad6 into abpframework:dev Mar 1, 2021
@realLiangshiwei
Copy link
Member

Thanks @PMExtra

@PMExtra PMExtra deleted the patch-1 branch March 3, 2021 08:09
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.

None yet

2 participants