public class XYZController : Controller
{
public ActionResult Index(ODataQueryOptions<Security> options = null)
{
var xyzs= GetXYZs().AsQueryable();
var results = options == null ? xyzs: options.ApplyTo(xyzs);
return View(xyzs);
}
}
这会导致“没有为此对象定义无参数构造函数”错误。不能将ODataQueryOptions与(常规 - 不是webapi)控制器派生类一起使用?
我基本上想要将符合odata的参数传递给常规控制器。
难道这不行吗?
谢谢 - 我不知道是否有一种方法手动实例从该ODataQueryOptions请求上下文或传入过滤器,排序,组,计数等字符串patameters然后以某种方式用于手动初始化ODataQueryOptions上下文... – t316