예제 #1
0
 public ActionResult Play(int id, song song)
 {
     song.song_view       = song.song_view + 1;
     db.Entry(song).State = EntityState.Modified;
     db.SaveChanges();
     return(View());
 }
예제 #2
0
 public bool Delete(int?id)
 {
     try
     {
         var album = db.albums.Find(id);
         db.albums.Remove(album);
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
예제 #3
0
 public bool Delete(int?id)
 {
     try
     {
         var song = db.songs.Find(id);
         db.songs.Remove(song);
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
예제 #4
0
 public int Insert(author entity)
 {
     db.authors.Add(entity);
     db.SaveChanges();
     return(entity.author_id);
 }
예제 #5
0
파일: LoginDAO.cs 프로젝트: 5ju4ypzz/180518
 public int Insert(user entity)
 {
     db.users.Add(entity);
     db.SaveChanges();
     return(entity.user_id);
 }