using System.Collections.Generic; using System.Linq; using LiteDB; using skydiveLogs_api.Data.Interface; using skydiveLogs_api.Model; namespace skydiveLogs_api.Data { public class DropZoneRepository : IDropZoneRepository { public DropZoneRepository(IDataProvider dataProvider) { _dataProvider = dataProvider; _col = _dataProvider.CollOfDropZone; } public IEnumerable GetAll() { return _col.FindAll().ToList(); } public DropZone GetById(int id) { return _col.FindById(new BsonValue(id)); } public bool Update(DropZone updatedDz) { return _col.Update(updatedDz); } private readonly IDataProvider _dataProvider; private readonly LiteCollection _col; } }