Example #1
0
 public void Put(int id, Fotoserie fotoserie)
 {
     fotoserie.Id = id;
     if (!repository.Update(fotoserie))
     {
         throw new HttpResponseException(HttpStatusCode.NotFound);
     }
 }
Example #2
0
        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);
        }
Example #3
0
 public Fotoserie Post(Fotoserie fotoserie)
 {
     return(repository.Add(fotoserie));
 }