WEB API
WEB API public class CustomerController : ApiController { private OrderMgmtEntities db = new OrderMgmtEntities (); // GET api/Customer public IEnumerable < Customer > GetCustomers() { return db.Customers.AsEnumerable(); } // GET api/Customer/5 public Customer GetCustomer( int id) { Customer customer = db.Customers.Find(id); if (customer == null ) { throw new HttpResponseException (Request.CreateResponse( HttpStatusCode .NotFound)); } return customer; ...
Comments
Post a Comment