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
Conversation
As same as abpframework#5697, and fix a bug.
|
||
return mongoDbRepository; | ||
if (repository is IMongoDbRepository<TEntity> mongoDbRepository) return mongoDbRepository; | ||
throw new ArgumentException("Given repository does not implement " + typeof(IMongoDbRepository<TEntity>).AssemblyQualifiedName, nameof(repository)); |
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.
This is just making it more readable and not change any logic.
{ | ||
return repository.ToMongoDbRepository().GetAggregateAsync(cancellationToken); |
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.
There is a recursive call because the IMongoDbRepository
does not have the GetAggregateAsync
method.
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.
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.
Sorry, I tested the code with 4.2.1 library so I missed the new feature. I will rollback it.
Thanks @PMExtra |
As same as #5697