我对 RazorRockstars 示例有疑问。我已将请求类上的主路由 ( /rockstars
)重命名为,现在它不再加载。看来路线是保留的。是这样吗?我希望在我的应用程序中使用这条路线。Rockstars
/properties
/properties
作品:
[Route("/rockstars")]
[Route("/rockstars/{Id}")]
[Route("/rockstars/aged/{Age}")]
public class Rockstars
{
public int? Age { get; set; }
public int Id { get; set; }
}
作品:
[Route("/blahblahblah")]
[Route("/blahblahblah/{Id}")]
[Route("/blahblahblah/aged/{Age}")]
public class Rockstars
{
public int? Age { get; set; }
public int Id { get; set; }
}
不工作:
[Route("/properties")]
[Route("/properties/{Id}")]
[Route("/properties/aged/{Age}")]
public class Rockstars
{
public int? Age { get; set; }
public int Id { get; set; }
}