21 lines
556 B
C#
21 lines
556 B
C#
using MongoDB.Driver;
|
|
|
|
|
|
namespace ServerBase;
|
|
|
|
|
|
// HANDOVER: MongoDB IMongoCollection SDK Wrapper 클래스 이다.
|
|
|
|
public class MongoDbRepository<TCollection>
|
|
where TCollection : class
|
|
{
|
|
protected IMongoCollection<TCollection> m_collection;
|
|
|
|
protected MongoDbRepository(IMongoClient client, string database, string collection)
|
|
{
|
|
var mongoDb = client.GetDatabase(database);
|
|
m_collection = mongoDb.GetCollection<TCollection>(collection);
|
|
}
|
|
|
|
public IMongoCollection<TCollection> getCollection() => m_collection;
|
|
} |