Esempio n. 1
0
        // PUT /api/albums/5
        public void Put(int id, Album value)
        {
            var album = entities.Albums.SingleOrDefault(a => a.AlbumId == id);

            entities.Entry(album).CurrentValues.SetValues(value);
            entities.SaveChanges();
        }
Esempio n. 2
0
 // POST /api/albums
 public void Post(Album value)
 {
     entities.Albums.Add(value);
     entities.SaveChanges();
 }