namespace RecordMyRuck.Models { public class RuckRepository : IRuckRepository { RecordMyRuckDbContext _dbContext; public RuckRepository(RecordMyRuckDbContext dbContext) { _dbContext = dbContext; } public void CreateRuck(Ruck ruck) { _dbContext.Rucks.Add(ruck); _dbContext.SaveChanges(); } public Ruck? Get(DateTime dateTime) { return _dbContext.Rucks.FirstOrDefault(r => r.DateTime == dateTime); } public IEnumerable GetAll() { return _dbContext.Rucks; } } }