我正在学习MVC4,接触到了Entity Framework的概念。但是我想知道在MVC 4中如何使用旧式的SQL语句。
比如说我有这个带有EF代码的操作:
public ActionResult Index(){
var model = from r in restaruants
select r;
return View(model);
}
在index函数中,是否可以使用旧式的SQL而不是EF?
我所说的旧式SQL是像"select * from restaurant"这样的语句。
public ActionResult Index(){
/* Can I have something like this? */
var model = Return_Model_Somehow("select * from restaurants");
return View(model);
}