标签: entity-framework-4.2

DbSet.Remove和DbContext.Entry(entity)之间的区别.State = EntityState.Deleted

考虑以下实体模型:

public class Agreement : Entity
{
    public int AgreementId { get; set; }
    public virtual ICollection<Participant> Participants { get; set; }
}

public class Establishment : Entity
{
    public int EstablishmentId { get; set; }
}

public class Participant : Entity
{
    public int AgreementId { get; set; }
    public virtual Agreement Agreement { get; set; }

    public int EstablishmentId { get; set; }
    public virtual Establishment { get; set; }

    public bool IsOwner { get; set; }
} …
Run Code Online (Sandbox Code Playgroud)

entity-framework entity-framework-4 entity-framework-4.1 entity-framework-4.2

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