예제 #1
0
        public bool Update(ContentViewModel dt, int id)
        {
            Content dr = db.Contents.Where(i => i.Id == id).FirstOrDefault();

            dr.Id = dt.ID;
            var Result = db.SaveChanges();

            return(Result == 1);
        }
예제 #2
0
        public bool Delete(ContentViewModel dt, int id)
        {
            Content dr = db.Contents.Where(i => i.Id == id).FirstOrDefault();

            db.Contents.Remove(dr);
            var Result = db.SaveChanges();

            return(Result == 1);
        }
예제 #3
0
        public int Insert(ContentViewModel dt)
        {
            Content dr = new Content();

            dr.Id = dt.ID;
            var Result = db.SaveChanges();

            return(dr.Id);
        }