public void DeleteData(int id) { var db = new BestSleepEntities(); var bestsleep = db.BestSleeps.Find(id); db.BestSleeps.Remove(bestsleep); db.SaveChanges(); }
public void CreateData(string diary, string quality) { var bestsleep = new BestSleep(); bestsleep.DIARY = diary; bestsleep.Quality = quality; var db = new BestSleepEntities(); db.BestSleeps.Add(bestsleep); db.SaveChanges(); }
public BestSleep GetData(int id) { var db = new BestSleepEntities(); return(db.BestSleeps.Find(id)); }
public BestSleep[] GetData() { var db = new BestSleepEntities(); return(db.BestSleeps.ToArray()); }