rename after full refactor

This commit is contained in:
Alexandre SPIESER
2019-04-14 19:31:28 +01:00
parent 0626292d09
commit 2207f2f1a1
14 changed files with 37 additions and 34 deletions
@@ -11,10 +11,13 @@ namespace MongoDbGenericRepository
/// <summary> /// <summary>
/// The IBaseMongoRepository exposes the CRUD functionality of the BaseMongoRepository. /// The IBaseMongoRepository exposes the CRUD functionality of the BaseMongoRepository.
/// </summary> /// </summary>
public interface IBaseMongoRepository : IReadOnlyMongoRepository, IBaseMongoRepository_Create, IBaseMongoRepository_Update, IBaseMongoRepository_Delete, IBaseMongoRepository_Index public interface IBaseMongoRepository :
IReadOnlyMongoRepository,
IBaseMongoRepository_Create,
IBaseMongoRepository_Update,
IBaseMongoRepository_Delete,
IBaseMongoRepository_Index
{ {
/// <summary> /// <summary>
/// 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>
@@ -8,7 +8,7 @@ using MongoDbGenericRepository.Models;
namespace MongoDbGenericRepository namespace MongoDbGenericRepository
{ {
public interface IKeyTypedReadOnlyMongoRepository<TKey> where TKey : IEquatable<TKey> public interface IReadOnlyMongoRepository<TKey> where TKey : IEquatable<TKey>
{ {
#region Read #region Read
@@ -9,7 +9,7 @@ namespace MongoDbGenericRepository
/// <summary> /// <summary>
/// The IReadOnlyMongoRepository exposes the readonly functionality of the BaseMongoRepository. /// The IReadOnlyMongoRepository exposes the readonly functionality of the BaseMongoRepository.
/// </summary> /// </summary>
public interface IReadOnlyMongoRepository : IBaseReadOnlyRepository, IKeyTypedReadOnlyMongoRepository<Guid> public interface IReadOnlyMongoRepository : IBaseReadOnlyRepository, IReadOnlyMongoRepository<Guid>
{ {
} }
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace MongoDbGenericRepository namespace MongoDbGenericRepository
{ {
public interface IBaseMongoRepository_Create : IKeyTypedBaseMongoDbRepository_Create<Guid> public interface IBaseMongoRepository_Create : IBaseMongoRepository_Create<Guid>
{ {
/// <summary> /// <summary>
/// Asynchronously adds a document to the collection. /// Asynchronously adds a document to the collection.
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace MongoDbGenericRepository namespace MongoDbGenericRepository
{ {
public interface IBaseMongoRepository_Delete : IKeyTypedBaseMongoDbRepository_Delete<Guid> public interface IBaseMongoRepository_Delete : IBaseMongoRepository_Delete<Guid>
{ {
/// <summary> /// <summary>
/// Deletes a document. /// Deletes a document.
@@ -7,7 +7,7 @@ using MongoDbGenericRepository.Models;
namespace MongoDbGenericRepository namespace MongoDbGenericRepository
{ {
public interface IBaseMongoRepository_Index : IKeyTypedBaseMongoDbRepository_Index<Guid> public interface IBaseMongoRepository_Index : IBaseMongoRepository_Index<Guid>
{ {
/// <summary> /// <summary>
/// Returns the names of the indexes present on a collection. /// Returns the names of the indexes present on a collection.
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace MongoDbGenericRepository namespace MongoDbGenericRepository
{ {
public interface IBaseMongoRepository_Update : IKeyTypedBaseMongoDbRepository_Update<Guid> public interface IBaseMongoRepository_Update : IBaseMongoRepository_Update<Guid>
{ {
/// <summary> /// <summary>
/// Asynchronously Updates a document. /// Asynchronously Updates a document.
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace MongoDbGenericRepository namespace MongoDbGenericRepository
{ {
public interface IKeyTypedBaseMongoDbRepository_Create<TKey> where TKey : IEquatable<TKey> public interface IBaseMongoRepository_Create<TKey> where TKey : IEquatable<TKey>
{ {
/// <summary> /// <summary>
/// Asynchronously adds a document to the collection. /// Asynchronously adds a document to the collection.
@@ -46,7 +46,7 @@ namespace MongoDbGenericRepository
/// Its constructor must be given a connection string and a database name. /// Its constructor must be given a connection string and a database name.
/// </summary> /// </summary>
/// <typeparam name="TKey"></typeparam> /// <typeparam name="TKey"></typeparam>
public abstract partial class KeyTypedBaseMongoDbRepository<TKey> : IKeyTypedBaseMongoDbRepository_Create<TKey> where TKey : IEquatable<TKey> public abstract partial class BaseMongoRepository<TKey> : IBaseMongoRepository_Create<TKey> where TKey : IEquatable<TKey>
{ {
protected MongoDbCreator _mongoDbCreator; protected MongoDbCreator _mongoDbCreator;
protected MongoDbCreator MongoDbCreator protected MongoDbCreator MongoDbCreator
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace MongoDbGenericRepository namespace MongoDbGenericRepository
{ {
public interface IKeyTypedBaseMongoDbRepository_Delete<TKey> where TKey : IEquatable<TKey> public interface IBaseMongoRepository_Delete<TKey> where TKey : IEquatable<TKey>
{ {
/// <summary> /// <summary>
/// Deletes a document. /// Deletes a document.
@@ -94,7 +94,7 @@ namespace MongoDbGenericRepository
where TDocument : IDocument<TKey>; where TDocument : IDocument<TKey>;
} }
public abstract partial class KeyTypedBaseMongoDbRepository<TKey>: IKeyTypedBaseMongoDbRepository_Delete<TKey> public abstract partial class BaseMongoRepository<TKey>: IBaseMongoRepository_Delete<TKey>
where TKey : IEquatable<TKey> where TKey : IEquatable<TKey>
{ {
private MongoDbEraser _mongoDbEraser; private MongoDbEraser _mongoDbEraser;
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace MongoDbGenericRepository namespace MongoDbGenericRepository
{ {
public interface IKeyTypedBaseMongoDbRepository_Index<TKey> where TKey : IEquatable<TKey> public interface IBaseMongoRepository_Index<TKey> where TKey : IEquatable<TKey>
{ {
/// <summary> /// <summary>
/// Returns the names of the indexes present on a collection. /// Returns the names of the indexes present on a collection.
@@ -98,7 +98,7 @@ namespace MongoDbGenericRepository
/// Its constructor must be given a connection string and a database name. /// Its constructor must be given a connection string and a database name.
/// </summary> /// </summary>
/// <typeparam name="TKey"></typeparam> /// <typeparam name="TKey"></typeparam>
public abstract partial class KeyTypedBaseMongoDbRepository<TKey> : IKeyTypedBaseMongoDbRepository_Index<TKey> public abstract partial class BaseMongoRepository<TKey> : IBaseMongoRepository_Index<TKey>
where TKey : IEquatable<TKey> where TKey : IEquatable<TKey>
{ {
private MongoDbIndexHandler _mongoDbIndexHandler; private MongoDbIndexHandler _mongoDbIndexHandler;
@@ -4,12 +4,12 @@ using System;
namespace MongoDbGenericRepository namespace MongoDbGenericRepository
{ {
public interface IKeyTypedBaseMongoDbRepository<TKey> : public interface IBaseMongoDbRepository<TKey> :
IKeyTypedReadOnlyMongoRepository<TKey>, IReadOnlyMongoRepository<TKey>,
IKeyTypedBaseMongoDbRepository_Create<TKey>, IBaseMongoRepository_Create<TKey>,
IKeyTypedBaseMongoDbRepository_Delete<TKey>, IBaseMongoRepository_Delete<TKey>,
IKeyTypedBaseMongoDbRepository_Index<TKey>, IBaseMongoRepository_Index<TKey>,
IKeyTypedBaseMongoDbRepository_Update<TKey> IBaseMongoRepository_Update<TKey>
where TKey : IEquatable<TKey> where TKey : IEquatable<TKey>
{ {
} }
@@ -19,9 +19,9 @@ namespace MongoDbGenericRepository
/// Its constructor must be given a connection string and a database name. /// Its constructor must be given a connection string and a database name.
/// </summary> /// </summary>
/// <typeparam name="TKey"></typeparam> /// <typeparam name="TKey"></typeparam>
public abstract partial class KeyTypedBaseMongoDbRepository<TKey> : public abstract partial class BaseMongoRepository<TKey> :
KeyTypedReadOnlyMongoRepository<TKey>, ReadOnlyMongoRepository<TKey>,
IKeyTypedBaseMongoDbRepository<TKey> IBaseMongoDbRepository<TKey>
where TKey : IEquatable<TKey> where TKey : IEquatable<TKey>
{ {
protected readonly object _initLock = new object(); protected readonly object _initLock = new object();
@@ -31,7 +31,7 @@ namespace MongoDbGenericRepository
/// </summary> /// </summary>
/// <param name="connectionString">The connection string of the MongoDb server.</param> /// <param name="connectionString">The connection string of the MongoDb server.</param>
/// <param name="databaseName">The name of the database against which you want to perform operations.</param> /// <param name="databaseName">The name of the database against which you want to perform operations.</param>
protected KeyTypedBaseMongoDbRepository(string connectionString, string databaseName = null) : base(connectionString, databaseName) protected BaseMongoRepository(string connectionString, string databaseName = null) : base(connectionString, databaseName)
{ {
} }
@@ -39,7 +39,7 @@ namespace MongoDbGenericRepository
/// The contructor taking a <see cref="IMongoDbContext"/>. /// The contructor taking a <see cref="IMongoDbContext"/>.
/// </summary> /// </summary>
/// <param name="mongoDbContext">A mongodb context implementing <see cref="IMongoDbContext"/></param> /// <param name="mongoDbContext">A mongodb context implementing <see cref="IMongoDbContext"/></param>
protected KeyTypedBaseMongoDbRepository(IMongoDbContext mongoDbContext) : base(mongoDbContext) protected BaseMongoRepository(IMongoDbContext mongoDbContext) : base(mongoDbContext)
{ {
} }
@@ -47,7 +47,7 @@ namespace MongoDbGenericRepository
/// The contructor taking a <see cref="IMongoDatabase"/>. /// The contructor taking a <see cref="IMongoDatabase"/>.
/// </summary> /// </summary>
/// <param name="mongoDatabase">A mongodb context implementing <see cref="IMongoDatabase"/></param> /// <param name="mongoDatabase">A mongodb context implementing <see cref="IMongoDatabase"/></param>
protected KeyTypedBaseMongoDbRepository(IMongoDatabase mongoDatabase) : base(mongoDatabase) protected BaseMongoRepository(IMongoDatabase mongoDatabase) : base(mongoDatabase)
{ {
} }
@@ -13,7 +13,7 @@ namespace MongoDbGenericRepository
/// The base Repository, it is meant to be inherited from by your custom custom MongoRepository implementation. /// The base Repository, it is meant to be inherited from by your custom custom MongoRepository implementation.
/// Its constructor must be given a connection string and a database name. /// Its constructor must be given a connection string and a database name.
/// </summary> /// </summary>
public abstract partial class KeyTypedReadOnlyMongoRepository<TKey> : IKeyTypedReadOnlyMongoRepository<TKey> where TKey : IEquatable<TKey> public abstract partial class ReadOnlyMongoRepository<TKey> : IReadOnlyMongoRepository<TKey> where TKey : IEquatable<TKey>
{ {
/// <summary> /// <summary>
/// The connection string. /// The connection string.
@@ -40,7 +40,7 @@ namespace MongoDbGenericRepository
/// </summary> /// </summary>
/// <param name="connectionString">The connection string of the MongoDb server.</param> /// <param name="connectionString">The connection string of the MongoDb server.</param>
/// <param name="databaseName">The name of the database against which you want to perform operations.</param> /// <param name="databaseName">The name of the database against which you want to perform operations.</param>
protected KeyTypedReadOnlyMongoRepository(string connectionString, string databaseName = null) protected ReadOnlyMongoRepository(string connectionString, string databaseName = null)
{ {
SetupMongoDbContext(connectionString, databaseName); SetupMongoDbContext(connectionString, databaseName);
} }
@@ -49,7 +49,7 @@ namespace MongoDbGenericRepository
/// The contructor taking a <see cref="IMongoDatabase"/>. /// The contructor taking a <see cref="IMongoDatabase"/>.
/// </summary> /// </summary>
/// <param name="mongoDatabase">A mongodb context implementing <see cref="IMongoDatabase"/></param> /// <param name="mongoDatabase">A mongodb context implementing <see cref="IMongoDatabase"/></param>
protected KeyTypedReadOnlyMongoRepository(IMongoDatabase mongoDatabase) : this(new MongoDbContext(mongoDatabase)) protected ReadOnlyMongoRepository(IMongoDatabase mongoDatabase) : this(new MongoDbContext(mongoDatabase))
{ {
} }
@@ -57,7 +57,7 @@ namespace MongoDbGenericRepository
/// The contructor taking a <see cref="IMongoDbContext"/>. /// The contructor taking a <see cref="IMongoDbContext"/>.
/// </summary> /// </summary>
/// <param name="mongoDbContext">A mongodb context implementing <see cref="IMongoDbContext"/></param> /// <param name="mongoDbContext">A mongodb context implementing <see cref="IMongoDbContext"/></param>
protected KeyTypedReadOnlyMongoRepository(IMongoDbContext mongoDbContext) protected ReadOnlyMongoRepository(IMongoDbContext mongoDbContext)
{ {
SetupMongoDbContext(mongoDbContext); SetupMongoDbContext(mongoDbContext);
} }
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace MongoDbGenericRepository namespace MongoDbGenericRepository
{ {
public interface IKeyTypedBaseMongoDbRepository_Update<TKey> where TKey : IEquatable<TKey> public interface IBaseMongoRepository_Update<TKey> where TKey : IEquatable<TKey>
{ {
/// <summary> /// <summary>
/// Asynchronously Updates a document. /// Asynchronously Updates a document.
@@ -112,7 +112,7 @@ namespace MongoDbGenericRepository
where TDocument : IDocument<TKey>; where TDocument : IDocument<TKey>;
} }
public abstract partial class KeyTypedBaseMongoDbRepository<TKey> : IKeyTypedBaseMongoDbRepository_Update<TKey> public abstract partial class BaseMongoRepository<TKey> : IBaseMongoRepository_Update<TKey>
where TKey : IEquatable<TKey> where TKey : IEquatable<TKey>
{ {
private MongoDbUpdater _mongoDbUpdater; private MongoDbUpdater _mongoDbUpdater;
@@ -13,7 +13,7 @@ namespace MongoDbGenericRepository
/// The base Repository, it is meant to be inherited from by your custom custom MongoRepository implementation. /// The base Repository, it is meant to be inherited from by your custom custom MongoRepository implementation.
/// Its constructor must be given a connection string and a database name. /// Its constructor must be given a connection string and a database name.
/// </summary> /// </summary>
public abstract class ReadOnlyMongoRepository : KeyTypedReadOnlyMongoRepository<Guid>, IReadOnlyMongoRepository public abstract class ReadOnlyMongoRepository : ReadOnlyMongoRepository<Guid>, IReadOnlyMongoRepository
{ {
/// <summary> /// <summary>
/// The constructor taking a connection string and a database name. /// The constructor taking a connection string and a database name.