您好,当我尝试删除“绑定”表中的一行时,我遇到了实体框架问题。
这些表看起来像这样:
[Table("Users")]
public class UserEntity : BaseEntity
{
[Required]
[MaxLength(30)]
public string Username { get; set; }
[Required]
[MaxLength(200)]
public string Password { get; set; }
[Required]
[MaxLength(200)]
public string Name { get; set; }
[Required]
[MaxLength(20)]
public string Cellphone { get; set; }
public virtual ICollection<UserGroupEntity> UserGroups { get; set; }
[Table("Groups")]
public class GroupEntity : BaseEntity
{
[Required]
[MaxLength(20)]
public string Code { get; set; }
[Required]
[MaxLength(200)]
public string Name { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
现在我有了将这两者绑定在一起的表: …