Update IoC and the "GET" function in the repository (lock issue)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user