Beispiel #1
0
        public HttpResponseMessage One(string name)
        {
            var wonder = WonderFactory.All().FirstOrDefault(w => string.CompareOrdinal(w.Name, name) == 0);

            return(wonder != default(Wonder)
                ? Request.CreateResponse(HttpStatusCode.OK, wonder)
                : Request.CreateErrorResponse(HttpStatusCode.NoContent, $"Failed to find a wonder with name {name}"));
        }
Beispiel #2
0
 public HttpResponseMessage All()
 {
     return(Request.CreateResponse(HttpStatusCode.OK, WonderFactory.All()));
 }