removing volatile

This commit is contained in:
Sean Garrett
2023-06-15 18:32:12 +01:00
parent 02b9385fd8
commit e23f659ffe
11 changed files with 11 additions and 22 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>IntegrationTests</RootNamespace> <RootNamespace>IntegrationTests</RootNamespace>
<AssemblyName>IntegrationTests</AssemblyName> <AssemblyName>IntegrationTests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp> </NuGetPackageImportStamp>
@@ -253,7 +253,6 @@ namespace MongoDbGenericRepository
/// Asynchronously returns a projected document matching the filter condition. /// Asynchronously returns a projected document matching the filter condition.
/// </summary> /// </summary>
/// <typeparam name="TDocument">The type representing a Document.</typeparam> /// <typeparam name="TDocument">The type representing a Document.</typeparam>
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
/// <typeparam name="TProjection">The type representing the model you want to project to.</typeparam> /// <typeparam name="TProjection">The type representing the model you want to project to.</typeparam>
/// <param name="filter">A LINQ expression filter.</param> /// <param name="filter">A LINQ expression filter.</param>
/// <param name="projection">The projection expression.</param> /// <param name="projection">The projection expression.</param>
@@ -346,7 +345,6 @@ namespace MongoDbGenericRepository
/// Asynchronously returns a paginated list of the documents matching the filter condition. /// Asynchronously returns a paginated list of the documents matching the filter condition.
/// </summary> /// </summary>
/// <typeparam name="TDocument">The type representing a Document.</typeparam> /// <typeparam name="TDocument">The type representing a Document.</typeparam>
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
/// <param name="filter">A LINQ expression filter.</param> /// <param name="filter">A LINQ expression filter.</param>
/// <param name="sortSelector">The property selector.</param> /// <param name="sortSelector">The property selector.</param>
/// <param name="ascending">Order of the sorting.</param> /// <param name="ascending">Order of the sorting.</param>
@@ -366,7 +364,6 @@ namespace MongoDbGenericRepository
/// Asynchronously returns a paginated list of the documents matching the filter condition. /// Asynchronously returns a paginated list of the documents matching the filter condition.
/// </summary> /// </summary>
/// <typeparam name="TDocument">The type representing a Document.</typeparam> /// <typeparam name="TDocument">The type representing a Document.</typeparam>
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
/// <param name="filter">A LINQ expression filter.</param> /// <param name="filter">A LINQ expression filter.</param>
/// <param name="sortDefinition">The sort definition.</param> /// <param name="sortDefinition">The sort definition.</param>
/// <param name="skipNumber">The number of documents you want to skip. Default value is 0.</param> /// <param name="skipNumber">The number of documents you want to skip. Default value is 0.</param>
@@ -14,7 +14,7 @@ namespace MongoDbGenericRepository
public abstract partial class BaseMongoRepository : IBaseMongoRepository_Create public abstract partial class BaseMongoRepository : IBaseMongoRepository_Create
{ {
private readonly object _initLock = new object(); private readonly object _initLock = new object();
private volatile IMongoDbCreator _mongoDbCreator; private IMongoDbCreator _mongoDbCreator;
/// <summary> /// <summary>
/// The MongoDbCreator field. /// The MongoDbCreator field.
@@ -9,7 +9,7 @@ namespace MongoDbGenericRepository
{ {
public abstract partial class BaseMongoRepository : IBaseMongoRepository_Delete public abstract partial class BaseMongoRepository : IBaseMongoRepository_Delete
{ {
private volatile IMongoDbEraser _mongoDbEraser; private IMongoDbEraser _mongoDbEraser;
/// <summary> /// <summary>
/// The MongoDbEraser used to delete documents. /// The MongoDbEraser used to delete documents.
@@ -13,7 +13,7 @@ namespace MongoDbGenericRepository
/// </summary> /// </summary>
public abstract partial class BaseMongoRepository : IBaseMongoRepository_Index public abstract partial class BaseMongoRepository : IBaseMongoRepository_Index
{ {
private volatile IMongoDbIndexHandler _mongoDbIndexHandler; private IMongoDbIndexHandler _mongoDbIndexHandler;
/// <summary> /// <summary>
/// The MongoDb accessor to manage indexes. /// The MongoDb accessor to manage indexes.
@@ -13,7 +13,7 @@ namespace MongoDbGenericRepository
/// </summary> /// </summary>
public abstract partial class BaseMongoRepository : IBaseMongoRepository_Update public abstract partial class BaseMongoRepository : IBaseMongoRepository_Update
{ {
private volatile IMongoDbUpdater _mongoDbUpdater; private IMongoDbUpdater _mongoDbUpdater;
/// <summary> /// <summary>
/// The MongoDb accessor to update data. /// The MongoDb accessor to update data.
@@ -14,7 +14,7 @@ namespace MongoDbGenericRepository
public abstract partial class BaseMongoRepository<TKey> : IBaseMongoRepository_Create<TKey> public abstract partial class BaseMongoRepository<TKey> : IBaseMongoRepository_Create<TKey>
where TKey : IEquatable<TKey> where TKey : IEquatable<TKey>
{ {
private volatile IMongoDbCreator _mongoDbCreator; private IMongoDbCreator _mongoDbCreator;
/// <summary> /// <summary>
/// The MongoDb accessor to insert data. /// The MongoDb accessor to insert data.
@@ -10,7 +10,7 @@ namespace MongoDbGenericRepository
public abstract partial class BaseMongoRepository<TKey>: IBaseMongoRepository_Delete<TKey> public abstract partial class BaseMongoRepository<TKey>: IBaseMongoRepository_Delete<TKey>
where TKey : IEquatable<TKey> where TKey : IEquatable<TKey>
{ {
private volatile IMongoDbEraser _mongoDbEraser; private IMongoDbEraser _mongoDbEraser;
/// <summary> /// <summary>
/// The MongoDb accessor to delete data. /// The MongoDb accessor to delete data.
@@ -14,7 +14,7 @@ namespace MongoDbGenericRepository
public abstract partial class BaseMongoRepository<TKey> : IBaseMongoRepository_Index<TKey> public abstract partial class BaseMongoRepository<TKey> : IBaseMongoRepository_Index<TKey>
where TKey : IEquatable<TKey> where TKey : IEquatable<TKey>
{ {
private volatile IMongoDbIndexHandler _mongoDbIndexHandler; private IMongoDbIndexHandler _mongoDbIndexHandler;
/// <summary> /// <summary>
/// The MongoDb accessor to manage indexes. /// The MongoDb accessor to manage indexes.
@@ -390,15 +390,7 @@ namespace MongoDbGenericRepository
#region Project #region Project
/// <summary> /// <inheritdoc cref="IReadOnlyMongoRepository"/>
/// Asynchronously returns a projected document matching the filter condition.
/// </summary>
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
/// <typeparam name="TProjection">The type representing the model you want to project to.</typeparam>
/// <param name="filter">A LINQ expression filter.</param>
/// <param name="projection">The projection expression.</param>
/// <param name="partitionKey">An optional partition key.</param>
public virtual async Task<TProjection> ProjectOneAsync<TDocument, TProjection>(Expression<Func<TDocument, bool>> filter, Expression<Func<TDocument, TProjection>> projection, string partitionKey = null) public virtual async Task<TProjection> ProjectOneAsync<TDocument, TProjection>(Expression<Func<TDocument, bool>> filter, Expression<Func<TDocument, TProjection>> projection, string partitionKey = null)
where TDocument : IDocument<TKey> where TDocument : IDocument<TKey>
where TProjection : class where TProjection : class
@@ -10,7 +10,7 @@ namespace MongoDbGenericRepository
public abstract partial class BaseMongoRepository<TKey> : IBaseMongoRepository_Update<TKey> public abstract partial class BaseMongoRepository<TKey> : IBaseMongoRepository_Update<TKey>
where TKey : IEquatable<TKey> where TKey : IEquatable<TKey>
{ {
private volatile IMongoDbUpdater _mongoDbUpdater; private IMongoDbUpdater _mongoDbUpdater;
/// <summary> /// <summary>
/// The MongoDb accessor to update data. /// The MongoDb accessor to update data.