// To save album in MusicStoreEntities. public Album Save(Album album) { if (album.AlbumId == 0) { //insert// storeDB.Albums.Add(album); } else { //Update// storeDB.Entry(album).State = System.Data.Entity.EntityState.Modified; } storeDB.SaveChanges(); return(album); }
public void UpdateOrder(Order order) { storeDB.Entry(order).State = EntityState.Modified; storeDB.SaveChanges(); }