예제 #1
0
        public void DeleteData(int id)
        {
            var db        = new BestSleepEntities();
            var bestsleep = db.BestSleeps.Find(id);

            db.BestSleeps.Remove(bestsleep);
            db.SaveChanges();
        }
예제 #2
0
        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();
        }
예제 #3
0
        public BestSleep GetData(int id)
        {
            var db = new BestSleepEntities();

            return(db.BestSleeps.Find(id));
        }
예제 #4
0
        public BestSleep[] GetData()
        {
            var db = new BestSleepEntities();

            return(db.BestSleeps.ToArray());
        }