【发布时间】:2015-01-21 20:31:50
【问题描述】:
我正在学习 ASP.NET MVC,但遇到了一些问题:
- 首先,我已将 NORTHWIND 数据库添加到我的 MVC 项目中
- 然后我为客户、订单、产品等创建了一些控制器。
- 为了创建控制器,我使用带有视图的脚手架,使用实体框架。
我写了一些Action方法:
public ActionResult GetAllCustomersWithOrders()
{
var orders = db.Customers.Where(p => p.Orders.Count > 1).ToList();
return View(orders);
}
public ActionResult GetAllOrdersFromCustomer()
{
var orders = db.Orders.Include(p => p.Employee).Include(p => p.Customer).Include(p => p.Shipper).Where(p => p.ShipCity == "Seattle").ToList();
return View(orders);
}
当我尝试编辑订单或客户时,我收到 400 错误。 以下是我在调用 action 方法后得到的结果。当我单击编辑或其他任何内容时,出现 400 错误。
这种行为的原因是什么?提前致谢。
【问题讨论】:
-
能否请您显示错误描述是什么??
-
它的错误请求错误。我不能提供更多,因为它不是英文的。
标签: asp.net asp.net-mvc asp.net-mvc-4