Tag: getmethod

如何使用GET方法发送JSON对象

我用WebApi2的控制器方法 [HttpGet] public IEnumerable GetProducts(ProductSearchCriteria searchCriteria) { //searchCriteria is always null here!!! Why? return db.Instance.LoadProducts(searchCriteria); } 我的搜索条件类 public class ProductSearchCriteria { private int id; private string name; private DateTime createdOn; [JsonProperty] public string Name { get { return this.name; } set { this.name = value; } } [JsonProperty] public DateTime CreatedOn { get { return […]