小编fer*_*and的帖子

.NET核心身份与IdentityServer4

问题:我应该使用.Net Core Identity或IdentityServer 4 with Identity

我需要使用登录/注册功能构建应用程序,并允许用户使用API​​从我的软件导入/导出数据.我也希望有外部登录,如谷歌,推特等.

而且我无法理解为什么在只使用Identity可以完成所有事情时我需要Identity Server.

我为什么需要或想要IdentityServer?我只需要尽可能简单地完成工作.

asp.net-core identityserver4 asp.net-core-identity

9
推荐指数
2
解决办法
4711
查看次数

EF CORE - Fluent API - 级联删除限制到表

该模型:

public class AccountUser
{
    public long AccountUserId { get; set; }
    ...
    public long UserPermissionGroupId { get; set; }
    public UserPermissionGroup UserPermissionGroup { get; set; }
}

public class UserPermissionGroup
{
    public long UserPermissionGroupId { get; set; }
    ...
    public string Name { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

问题: 如何在表AccountUser-> UserPermissionGroup上设置外键以限制删除?

我无法找到如何在删除操作上设置外键以限制只有一个表的示例.我不能使用类似WithMany/WithOne然后OnDelete如本例https://docs.microsoft.com/en-us/ef/core/modeling/relationships#cascade-delete-1因为我没有从UserPermissionGroup参考回到AccountUser.

非常感谢你.

c# ef-fluent-api .net-core ef-core-2.0

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