POCO控制器就是ASP.NET Core项目中所有带有Controller后缀的类、或者标记了[Controller]特性的类,虽然没有像模版项目中那样继承自Controller类,也会被识别为控制器,拥有跟普通控制器一样的功能,
csharp
public class PocoController
{
public IActionResult Index()
{
return new ContentResult() { Content = "Hello from POCO controller!" };
}
}
[Controller]
public class Poco
{
public IActionResult Index()
{
return new ContentResult() { Content = "Hello from POCO controller!" };
}
}