你怎么看?您的 DAO 应该返回一个 IQueryable 以便在您的 Controller 中使用它吗?
最佳答案
没有。您的 Controller 根本不应该处理任何复杂的逻辑。保持 slim ;模型(不是 DAO)应该将 Controller 交还给 View 所需的一切。
在 Controller 类中看到查询(甚至可查询)是我认为是代码味道的东西。
关于c# - ASP MVC : Should services return IQueryable's?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2215057/