public class FirstAPiController : ApiController
{
appDBEntities dbcontext = new appDBEntities();
public List<Models.Order_Num> GetOrder_Num()
{
List<Order_Num> list= dbcontext.Order_Num.Where<Order_Num>(c => true).ToList();
return list;
}
public Models.Order_Num GetOrder_Num(int id)
{
return null;
}
public bool DeleteOrder_Num(int id)
{
return true;
}
}
===========================
<script>
//$(function () {
// $("#btn").click(function () {
// GetOrder_NumHtml();
// });
//});
//function GetOrder_NumHtml() {
// $.get("/Api/FirstAPi/2941", {}, function (data) {
// console.info(data);
// });
//}
//===============================
$(function () {
$("#btn").click(function () {
deleteOrder_NumHtml();
});
});
function deleteOrder_NumHtml() {
$.ajax({
type: "delete",
url: "/Api/FirstAPi/2941"
});
}
</script>
<input type="button" name="name" value="Get请求 " id="btn" />