Changed database name
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
|
||||
using TextSender_API.Repositories;
|
||||
|
||||
public class BaseRepository
|
||||
{
|
||||
#region Fields
|
||||
protected string _connectionString;
|
||||
protected string _databaseName = "textSender";
|
||||
protected string _tableName;
|
||||
#endregion
|
||||
}
|
||||
@@ -8,12 +8,9 @@ using TextSender_API.Models;
|
||||
namespace TextSender_API.Repositories;
|
||||
|
||||
|
||||
public class UsersRepository
|
||||
public class UsersRepository : BaseRepository
|
||||
{
|
||||
#region Fields
|
||||
private string _connectionString;
|
||||
private string _databaseName;
|
||||
private string _tableName;
|
||||
private readonly IMongoCollection<User> _bookCollection;
|
||||
#endregion
|
||||
|
||||
@@ -22,7 +19,6 @@ public class UsersRepository
|
||||
public UsersRepository(string connectionString)
|
||||
{
|
||||
this._connectionString = connectionString;
|
||||
this._databaseName = "TextSender";
|
||||
this._tableName = "users";
|
||||
var client = this.InitializeClient();
|
||||
this._bookCollection = client.GetDatabase(this._databaseName).GetCollection<User>(this._tableName);
|
||||
@@ -74,12 +70,9 @@ public class UsersRepository
|
||||
}
|
||||
|
||||
|
||||
public class SaltRepository
|
||||
public class SaltRepository : BaseRepository
|
||||
{
|
||||
#region Fields
|
||||
private string _connectionString;
|
||||
private string _databaseName;
|
||||
private string _tableName;
|
||||
private readonly IMongoCollection<Salt> _bookCollection;
|
||||
#endregion
|
||||
|
||||
@@ -88,7 +81,6 @@ public class SaltRepository
|
||||
public SaltRepository(string connectionString)
|
||||
{
|
||||
this._connectionString = connectionString;
|
||||
this._databaseName = "TextSender";
|
||||
this._tableName = "salt";
|
||||
var client = this.InitializeClient();
|
||||
this._bookCollection = client.GetDatabase(this._databaseName).GetCollection<Salt>(this._tableName);
|
||||
|
||||
Reference in New Issue
Block a user