public IEnumerable <Camper> GetCampers(int year) { using (var context = new CampContext(_connectionString)) { return(context.Campers.Where(i => i.Year == year).ToList()); } }
public Camper GetCamperInfo(int id) { using (var context = new CampContext(_connectionString)) { return(context.Campers.FirstOrDefault(i => i.Id == id)); } }
public void AddCamper(Camper c) { using (var context = new CampContext(_connectionString)) { context.Campers.Add(c); context.SaveChanges(); } }