小编Dav*_*res的帖子

EFCore可为空的关系设置onDelete:ReferentialAction.Restrict

我正在运行efcore 2.0.1.

我有一个模特:

public class BigAwesomeDinosaurWithTeeth
{
    [Key]
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public Guid Id { get; set; }

    public ICollection<YummyPunyPrey> YummyPunyPrey { get; set; }
}
public class YummyPunyPrey
{
    [Key]
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public Guid Id { get; set; }
    public Guid? BigAwesomeDinosaurWithTeethId { get; set; }

    [ForeignKey("BigAwesomeDinosaurWithTeethId")]
    public BigAwesomeDinosaurWithTeeth BigAwesomeDinosaurWithTeeth { get; set; }

}
Run Code Online (Sandbox Code Playgroud)

我对这两个课程没有流利的api.但是当我生成迁移时

constraints: table =>
            {
                table.PrimaryKey("PK_YummyPunyPrey", x => x.Id);
                table.ForeignKey(
                    name: "FK_YummyPunyPrey_BigAwesomeDinosaurWithTeeth_BigAwesomeDinosaurWithTeethId",
                    column: x => x.BigAwesomeDinosaurWithTeethId,
                    principalTable: "BigAwesomeDinosaurWithTeeth",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Restrict);
            });
Run Code Online (Sandbox Code Playgroud)

为什么它生成onDelete:ReferentialAction.Restrict当文档说它应该作为ClientSetNull …

entity-framework ef-code-first entity-framework-core ef-core-2.0

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

我如何在红宝石中运行sass?

如何在ruby文件中调用sass函数?

以下行在命令提示符下工作:

sass C:\Users\..etc..\main.scss
Run Code Online (Sandbox Code Playgroud)

我需要把它放到一个Ruby文件中.所以我在Ruby文件中写了如下:

require 'sass'

$arg1 = 'C:/Users/dmoores/Desktop/testst/main.scss'
sass $arg1
Run Code Online (Sandbox Code Playgroud)

但它抱怨如下:

undefined method `sass' for main:Object (NoMethodError)
Run Code Online (Sandbox Code Playgroud)

ruby sass

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

如何从Azure B2C获取ASPCore中的OID声明

我为什么要这个?

我正在尝试从我的用户那里获取一个唯一的标识符,我可以将其连接到数据库记录.有理由我不想使用电子邮件作为标识符.我读到B2C不支持SUB声明,并在其中使用OID.

我采取的步骤

所以,我已经设置我的两个策略都返回Azure B2C上的对象ID:

在此输入图像描述

我目前正在使用单独的SignIn和SignUp政策,我收到所有索赔,包括我指定要退回的电子邮件索赔.但是,我无法找到与OID或SUB相关的声明.

User.Claims 
Run Code Online (Sandbox Code Playgroud)

让我得到以下结果:

在此输入图像描述

我发现的单一面包屑希望就是这种说法:

键入:http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier

值:目前不支持.使用oid声明.

问题

我是否错过了为检索此特定声明而需要执行的其他步骤?

有没有人有成功从Azure B2C检索OID或SUB?

claims-based-identity openid-connect azure-ad-b2c asp.net-core

4
推荐指数
3
解决办法
2165
查看次数