AJax¼¼Êõ

resourceʵÏÖOAuthµÄ×¢²á¡¢µÇ¼¡¢×¢ÏúºÍAPIµ÷ÓÃ(3)

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2017-09-10 14:02 ÎÒÒªÆÀÂÛ( )

Òþ²Ø´úÂë public class CustomersController : ApiController{private ApplicationDbContext db = new ApplicationDbContext();// GET: api/Customerspublic IQueryableCustomer GetCustomers(){return db.Customer

Òþ²Ø´úÂë

public class CustomersController : ApiController { private ApplicationDbContext db = new ApplicationDbContext(); // GET: api/Customers public IQueryable<Customer> GetCustomers() { return db.Customers; } // GET: api/Customers/5 [ResponseType(typeof(Customer))] public async Task<IHttpActionResult> GetCustomer(int id) { Customer customer = await db.Customers.FindAsync(id); if (customer == null) { return NotFound(); } return Ok(customer); } // PUT: api/Customers/5 [Authorize] [ResponseType(typeof(void))] public async Task<IHttpActionResult> PutCustomer(int id, Customer customer) { // ... } // POST: api/Customers [Authorize] [ResponseType(typeof(Customer))] public async Task<IHttpActionResult> PostCustomer(Customer customer) { // ... } // DELETE: api/Customers/5 [ResponseType(typeof(Customer))] [Authorize] public async Task<IHttpActionResult> DeleteCustomer(int id) { // ... } } ÈÃWeb APIÒÔCamelCaseÊä³öJSON

¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • ztreeµã»÷ÎÄ×Ö¹´Ñ¡checkbox£¬radioʵÏÖ·½·¨

    ztreeµã»÷ÎÄ×Ö¹´Ñ¡checkbox£¬radioʵÏÖ·½·¨

    2017-09-10 15:01

  • AjaxʵÏÖ--javascript

    AjaxʵÏÖ--javascript

    2017-09-06 11:03

  • ajax php ʵÏÖдÈëÊý¾Ý¿â

    ajax php ʵÏÖдÈëÊý¾Ý¿â

    2017-09-04 17:03

  • ÓÃajaxʵÏÖµÄ×Ô¶¯Í¶Æ±µÄ´úÂëjavascript¼¼ÇÉ

    ÓÃajaxʵÏÖµÄ×Ô¶¯Í¶Æ±µÄ´úÂëjavascript¼¼ÇÉ

    2017-09-04 13:01

ÍøÓѵãÆÀ
µ