public void Put(int id, Fotoserie fotoserie) { fotoserie.Id = id; if (!repository.Update(fotoserie)) { throw new HttpResponseException(HttpStatusCode.NotFound); } }
public Fotoserie Get(int id) { Fotoserie fotoserie = repository.Get(id); if (fotoserie == null) { var resp = new HttpResponseMessage(HttpStatusCode.NotFound) { Content = new StringContent(string.Format("Er bestaat geen fotoserie met Id = {0}", id)), ReasonPhrase = "Fotoserie Id niet gevonden" }; throw new HttpResponseException(resp); } return(fotoserie); }
public Fotoserie Post(Fotoserie fotoserie) { return(repository.Add(fotoserie)); }