api cu adaugare/revocare acces
This commit is contained in:
@@ -4,10 +4,10 @@ namespace Infrastructure.Services.MongoDB;
|
||||
|
||||
public class ChatMongoDbService : MongoDbService, IChatMongoDbService
|
||||
{
|
||||
public ChatMongoDbService(string connectionString, string databaseName, string collectionName)
|
||||
public ChatMongoDbService(string connectionString, string databaseName, string collectionName)
|
||||
: base(connectionString, databaseName, collectionName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// Implement additional methods specific to Chat database if needed
|
||||
}
|
||||
@@ -4,10 +4,10 @@ namespace Infrastructure.Services.MongoDB;
|
||||
|
||||
public class MedicalHistoryMongoDbService : MongoDbService, IMedicalHistoryMongoDbService
|
||||
{
|
||||
public MedicalHistoryMongoDbService(string connectionString, string databaseName, string collectionName)
|
||||
public MedicalHistoryMongoDbService(string connectionString, string databaseName, string collectionName)
|
||||
: base(connectionString, databaseName, collectionName)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// Implement additional methods specific to Medical History database if needed
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace Infrastructure.Services.MongoDB
|
||||
{
|
||||
_databaseName = databaseName;
|
||||
_collectionName = collectionName;
|
||||
|
||||
|
||||
Console.WriteLine($"Connection string: {connectionString}");
|
||||
Console.WriteLine($"Database Name: {databaseName}");
|
||||
Console.WriteLine($"Collection Name: {collectionName}");
|
||||
@@ -23,12 +23,12 @@ namespace Infrastructure.Services.MongoDB
|
||||
settings.ServerApi = new ServerApi(ServerApiVersion.V1);
|
||||
_database = new MongoClient(settings);
|
||||
|
||||
try
|
||||
try
|
||||
{
|
||||
var result = _database.GetDatabase("admin").RunCommand<BsonDocument>(new BsonDocument("ping", 1));
|
||||
Console.WriteLine("Pinged your deployment. You successfully connected to MongoDB!");
|
||||
}
|
||||
catch (Exception ex)
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
}
|
||||
@@ -71,4 +71,4 @@ namespace Infrastructure.Services.MongoDB
|
||||
await collection.DeleteOneAsync(filter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user