示例#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
 public int Insert(user entity)
 {
     db.users.Add(entity);
     db.SaveChanges();
     return(entity.user_id);
 }