-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Upgrade MongoDB.Driver
to 3.1.0
.
#21807
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
Conversation
Thanks for the upgrade. What are the breaking changes in that PR and how developers should apply these changes in their codebases? |
@maliming Can't we preserve |
No problem. I have changed the code. You can review it again. Thanks |
docs/en/framework/architecture/best-practices/mongodb-integration.md
Outdated
Show resolved
Hide resolved
|
||
Task<IMongoQueryable<TEntity>> GetMongoQueryableAsync(CancellationToken cancellationToken = default, AggregateOptions? options = null); | ||
[Obsolete("Use GetQueryableAsync method.")] | ||
Task<IQueryable<TEntity>> GetMongoQueryableAsync(CancellationToken cancellationToken = default, AggregateOptions? options = null); |
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.
You are changing return value from IMongoQueryable to IQueryable, which is a breaking change for existing applications. Just keep as current, without any change, and mark it as obsolete (you already did this one).
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 IMongoQueryable
is deleted from MongoDB.Driver
library.
[Obsolete("Use GetMongoQueryableAsync method.")] | ||
public static IMongoQueryable<TEntity> GetMongoQueryable<TEntity>(this IReadOnlyBasicRepository<TEntity> repository) | ||
[Obsolete("Use GetQueryableAsync method.")] | ||
public static IQueryable<TEntity> GetMongoQueryable<TEntity>(this IReadOnlyBasicRepository<TEntity> 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.
Don't change return value.
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 IMongoQueryable
is deleted from MongoDB.Driver
library.
where TEntity : class, IEntity | ||
{ | ||
return repository.ToMongoDbRepository().GetMongoQueryable(); | ||
} | ||
|
||
public static Task<IMongoQueryable<TEntity>> GetMongoQueryableAsync<TEntity>(this IReadOnlyBasicRepository<TEntity> repository, CancellationToken cancellationToken = default, AggregateOptions? aggregateOptions = null) | ||
[Obsolete("Use GetQueryableAsync method.")] | ||
public static Task<IQueryable<TEntity>> GetMongoQueryableAsync<TEntity>(this IReadOnlyBasicRepository<TEntity> repository, CancellationToken cancellationToken = default, AggregateOptions? aggregateOptions = null) |
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.
Don't change return value.
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 IMongoQueryable
is deleted from MongoDB.Driver
library.
where TEntity : class, IEntity | ||
{ | ||
return repository.ToMongoDbRepository().GetMongoQueryableAsync(cancellationToken, aggregateOptions); | ||
} | ||
|
||
[Obsolete("Use GetQueryableAsync method.")] | ||
public static IQueryable<TEntity> GetQueryable<TEntity>(this IReadOnlyBasicRepository<TEntity> 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.
It is not necessary to add a new method and making it obsolete. It is against obsolete's purpose. Just don't add such a method, no one already used it yet, so it is not a breaking change.
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.
Please read my previous change comments
…ion.md Co-authored-by: Halil İbrahim Kalkan <[email protected]>
Resolve #21491
Migration guide: https://github.com/abpframework/abp/blob/MongoDB.Driver.3/docs/en/release-info/migration-guides/MongoDB-Driver-2-to-3.md
MongoDB.Driver 3.x
:https://www.mongodb.com/docs/drivers/csharp/current/upgrade/v3/