小编Bel*_*vic的帖子

如何将 EF Core 中相关集合中的属性的 IsModified 设置为 false?

我正在使用 Asp.Net Core 1.1,我有两个类:

public class Scale
{
    [Key]
    public int ScaleId { get; set; }

    public string Name { get; set; }

    public string Description { get; set; }

    public decimal DefaultValue { get; set; }

    public List<ScaleLabel> Labels { get; set; }
}

public class ScaleLabel
{
    [Key]
    public int ScaleLabelId { get; set; }

    public int ScaleId { get; set; }
    public virtual Scale Scale { get; set; }

    public decimal Value { get; set; }

    public …
Run Code Online (Sandbox Code Playgroud)

c# entity-framework-core asp.net-core asp.net-core-1.1

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