Ejemplo n.º 1
0
        public void Get(IModelRequest request)
        {
            Book book = BookStore.GetBook(request.ResourceName);

            if (book == null)
            {
                request.NotFound();
            }
            else
            {
                request.Model(book);
            }
        }
Ejemplo n.º 2
0
        public void Get(IModelRequest req)
        {
            var customer = customers.FindById(new ObjectId(req.PathParam("id")));

            if (customer == null)
            {
                req.NotFound();
            }
            else
            {
                req.Model(customer);
            }
        }