我有一个这样的控制器:Asp.net MVC控制器接受值或空
public ActionResult mycontroller(int status, DateTime start, DateTime end)
{
...stuff
}
我这样称呼它:
http://localhost:22200/mycontroller?status=1&start=18/03/2015&end=18/04/2015
然而,有一半我需要调用时间它是这样的:
http://localhost:22200/mycontroller?status=1
我想为这两个调用使用相同的控制器。
有没有办法改变控制器接受或不参数?
PS:我不想有2个控制器或类似这样的
http://localhost:22200/mycontroller?status=1&start=null&end=null
任何帮助那里网址? 非常感谢。
做了'start'和'end'参数''日期时间(可为空) – 2015-03-19 01:20:44