public IEnumerable <FieldMeta> Metadata() { var key = (string)this.ControllerContext.RouteData.Values["key"]; Log.ObjectId = key; var result = _dg.Metadata(key); return(result); }
public async Task <ActionResult <object> > MetaQuery() { var key = (string)this.ControllerContext.RouteData.Values["key"]; Log.ObjectId = key; var dict = Request.Query.ToDictionary(kv => kv.Key, kv => (object)kv.Value.FirstOrDefault()); dict.Remove("_"); //排除jQuery的随机数 var meta = _dg.Metadata(key); var data = await _dg.QueryAsync(key, dict); //throw new ArgumentException("手动引发的异常"); return(new { meta, data }); }