2
为什么要创建异步WebAPI操作而不是同步操作?
我在创建的Web API中执行以下操作: // GET api/<controller> [HttpGet] [Route("pharmacies/{pharmacyId}/page/{page}/{filter?}")] public CartTotalsDTO GetProductsWithHistory(Guid pharmacyId, int page, string filter = null ,[FromUri] bool refresh = false) { return delegateHelper.GetProductsWithHistory(CustomerContext.Current.GetContactById(pharmacyId), refresh); } 通过以下方式通过Jquery Ajax调用完成对此Web服务的调用: $.ajax({ url: "/api/products/pharmacies/<%# Farmacia.PrimaryKeyId.Value.ToString() %>/page/" + vm.currentPage() + "/" + filter, type: "GET", dataType: "json", success: function (result) { vm.items([]); var …