在应用程序中,我希望导航到home/contract-view/10一个动作.试着
this.router.navigateToRoute(`home/contract-view`, { id: 10}, { absolute: true });
Run Code Online (Sandbox Code Playgroud)
失败了 Route home/contract-view not be found
另一个尝试:
this.router.navigate(`#/home/contract-view`, { id: 10});
Run Code Online (Sandbox Code Playgroud)
失败了Route not found: contract-view(…)
如何实现这一目标?App.ts:
configureRouter(config: RouterConfiguration, router: Router) {
config.title = 'Contracts Portal';
config.map([
{ route: ['', 'dummy'], name: 'dummy', moduleId: 'dummy', nav: false, title: 'Dummy', settings: { pos: 'left' } },
{ route: 'home', name: 'home', moduleId: 'home', nav: true, title: 'Home', settings:{pos: 'left', class: 'home' }, auth: true },
]);
this.router = router;
} …Run Code Online (Sandbox Code Playgroud) 我们Description在dot net CLI中有Enums的属性吗?(Dot Net Core RC2)如果没有,还有其他选择吗?
我使用MVC 6 rc1与EF 7 rc 1 Code First Model通过web api控制器检索数据.我有3个类似于下面的表.
class Product
{
public int Id { get; set; }
public string SomeProperty { get; set; }
public virtual ICollection<Categorization> Categorizations { get; set; }
public DateTime SomeProperty2 { get; set; }
public string SomeProperty3 { get; set; }
public string SomeProperty4 { get; set; }
}
// NOTE: Entity key should be (ProductId, CategoryId)
class Categorization
{
public int ProductId { get; set; }
public Product Product { get; …Run Code Online (Sandbox Code Playgroud) c# asp.net-mvc asp.net-web-api entity-framework-core asp.net-core-mvc