Adding default values to MvcSample.Web's FiltersController. Otherwise accessing the Actions would return 404 by default.
This commit is contained in:
parent
812d5328d2
commit
52c2e41bbb
|
|
@ -26,7 +26,7 @@ namespace MvcSample.Web
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[AgeEnhancer]
|
[AgeEnhancer]
|
||||||
[Delay(500)]
|
[Delay(500)]
|
||||||
public ActionResult Index(int age, string userName)
|
public ActionResult Index(int age = 20, string userName = "SampleUser")
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(userName))
|
if (!string.IsNullOrEmpty(userName))
|
||||||
{
|
{
|
||||||
|
|
@ -38,26 +38,26 @@ namespace MvcSample.Web
|
||||||
return View("MyView", CustomUser);
|
return View("MyView", CustomUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult Blocked(int age, string userName)
|
public ActionResult Blocked(int age = 20, string userName = "SampleUser")
|
||||||
{
|
{
|
||||||
return Index(age, userName);
|
return Index(age, userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Authorize("Permission", "CanViewPage")]
|
[Authorize("Permission", "CanViewPage")]
|
||||||
public ActionResult NotGrantedClaim(int age, string userName)
|
public ActionResult NotGrantedClaim(int age = 20, string userName = "SampleUser")
|
||||||
{
|
{
|
||||||
return Index(age, userName);
|
return Index(age, userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
[FakeUser]
|
[FakeUser]
|
||||||
[Authorize("Permission", "CanViewPage", "CanViewAnything")]
|
[Authorize("Permission", "CanViewPage", "CanViewAnything")]
|
||||||
public ActionResult AllGranted(int age, string userName)
|
public ActionResult AllGranted(int age = 20, string userName = "SampleUser")
|
||||||
{
|
{
|
||||||
return Index(age, userName);
|
return Index(age, userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ErrorMessages, AllowAnonymous]
|
[ErrorMessages, AllowAnonymous]
|
||||||
public ActionResult Crash(string message)
|
public ActionResult Crash(string message = "Sample crash message")
|
||||||
{
|
{
|
||||||
throw new Exception(message);
|
throw new Exception(message);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue