Update IoC and the "GET" function in the repository (lock issue)

This commit is contained in:
Sébastien André
2019-11-10 20:03:03 +01:00
parent f3f9b91a15
commit 2e6ec6ec85
9 changed files with 40 additions and 34 deletions

View File

@@ -24,16 +24,7 @@ namespace skydiveLogs_api.Data
public DropZone GetById(int id)
{
DropZone result;
using (var db = new LiteDatabase(@".\Data\MyData.db"))
{
var col = db.GetCollection<DropZone>("DropZone");
result = col.FindById(new BsonValue(id));
}
return result;
return _col.FindById(new BsonValue(id)); ;
}
private readonly IDataProvider _dataProvider;