Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Remove unused SetCollection method from IRepository.cs and its implementations

support37b5f419d8e3
diff --git a/src/Core/Grand.Data/IRepository.cs b/src/Core/Grand.Data/IRepository.cs
index c144bafe6..3634f3606 100644
--- a/src/Core/Grand.Data/IRepository.cs
+++ b/src/Core/Grand.Data/IRepository.cs
@@ -12,12 +12,7 @@ public interface IRepository<T> where T : BaseEntity
/// Gets a table
/// </summary>
IQueryable<T> Table { get; }
-
- /// <summary>
- /// Sets a collection
- /// </summary>
- bool SetCollection(string collectionName);
-
+
/// <summary>
/// Get entity by identifier
diff --git a/src/Core/Grand.Data/LiteDb/LiteDBRepository.cs b/src/Core/Grand.Data/LiteDb/LiteDBRepository.cs
index d8990feeb..f5b7d99c8 100644
--- a/src/Core/Grand.Data/LiteDb/LiteDBRepository.cs
+++ b/src/Core/Grand.Data/LiteDb/LiteDBRepository.cs
@@ -21,16 +21,7 @@ public class LiteDBRepository<T> : IRepository<T> where T : BaseEntity
protected ILiteCollection<T> _collection;
public ILiteCollection<T> Collection => _collection;
-
- /// <summary>
- /// Sets a collection
- /// </summary>
- public bool SetCollection(string collectionName)
- {
- _collection = _database.GetCollection<T>(collectionName);
- return true;
- }
-
+
/// <summary>
/// Mongo Database
/// </summary>
diff --git a/src/Core/Grand.Data/Mongo/MongoRepository.cs b/src/Core/Grand.Data/Mongo/MongoRepository.cs
index 1c94d7388..1f27aba52 100644
--- a/src/Core/Grand.Data/Mongo/MongoRepository.cs
+++ b/src/Core/Grand.Data/Mongo/MongoRepository.cs
@@ -21,15 +21,6 @@ public class MongoRepository<T> : IRepository<T> where T : BaseEntity
public IMongoCollection<T> Collection => _collection;
- /// <summary>
- /// Sets a collection
- /// </summary>
- public bool SetCollection(string collectionName)
- {
- _collection = _collection.Database.GetCollection<T>(collectionName);
- return true;
- }
-
/// <summary>
/// Mongo Database
/// </summary>