Update the repository pattern
This commit is contained in:
27
Back/skydiveLogs-api.Data/LiteDbProvider.cs
Normal file
27
Back/skydiveLogs-api.Data/LiteDbProvider.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using LiteDB;
|
||||
|
||||
using skydiveLogs_api.Data.Interface;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Data
|
||||
{
|
||||
public class LiteDbProvider : IDataProvider
|
||||
{
|
||||
public LiteDbProvider(string connectionString)
|
||||
{
|
||||
_db = new LiteDatabase(connectionString);
|
||||
}
|
||||
|
||||
public LiteCollection<T> GetCollection<T>()
|
||||
{
|
||||
return _db.GetCollection<T>();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
_db.Dispose();
|
||||
}
|
||||
|
||||
private readonly LiteDatabase _db;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user