小编Ale*_*lex的帖子

如何在Entity Framework Core中设置实体关系

这里我们在EF Core上有3个表:

  1. 新闻
  2. 项目
  3. 链接

还有更多(新闻,项目除外):内容,帖子,表格等

和我的模型定义

public class Item
{
    public int Id { get; set; }
    public string Name { get; set; }
    public decimal Price { get; set; }
    public Link Link { get; set; }
}

public class News
{
    public int Id { get; set; }
    public string Header { get; set; }
    public string Content { get; set; }
    public Link Link { get; set; }
}

public class Link
{
    public int Id …
Run Code Online (Sandbox Code Playgroud)

c# entity-framework-core .net-core asp.net-core ef-code-first-mapping

8
推荐指数
1
解决办法
438
查看次数

ASP.NET Core 2中不同区域的身份验证和LoginPath

ASP.NET Core 2

帮我配置AddAuthentication两条路由:用户(用户帐户)和管理区域。

例如,如果用户未登录并尝试输入,则将/Account/Orders/其重定向到/Account/SignIn/

但是,如果尝试访问的人/Admin/Orders/必须重新分配给/Admin/Signin/

尚未找到解决方案的ATM。

asp.net asp.net-authorization asp.net-core-mvc .net-core asp.net-core

4
推荐指数
1
解决办法
1516
查看次数