示例#1
0
        // GET /api/customers /1
        public Customer GetCustomer(int id)
        {
            Customer customer = _repo.GetCustomerById(id);

            if (customer == null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }
            else
            {
                return(customer);
            }
        }
示例#2
0
        //GET: Customer by id
        public ActionResult Details(int id)
        {
            Customer customer = _repo.GetCustomerById(id);

            return(View(customer));
        }