【发布时间】:2016-09-13 20:29:40
【问题描述】:
在本规范中
public ActionResult Index(int? id)
{
return View();
}
int? id 有什么作用?
我们也可以这样写吗?
public ActionResult Index()
{
int id;
return View();
}
【问题讨论】:
-
我更改了标题,所以看起来 OP 没有尝试搜索 bing.com/search?q=c%23+int+question+mark 并阅读有关可空类型的信息,例如 stackoverflow.com/questions/2690866/…
标签: c# asp.net-mvc