问题:我应该使用.Net Core Identity或IdentityServer 4 with Identity
我需要使用登录/注册功能构建应用程序,并允许用户使用API从我的软件导入/导出数据.我也希望有外部登录,如谷歌,推特等.
而且我无法理解为什么在只使用Identity可以完成所有事情时我需要Identity Server.
我为什么需要或想要IdentityServer?我只需要尽可能简单地完成工作.
该模型:
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.
非常感谢你.