这个问题开始出现后,我升级到1.4.9微风。
我有以下实体:
public class ProjectMember
{
public int ProjectId { get; set; }
[ForeignKey("ProjectId")]
[InverseProperty("ProjectMembers")]
public Project Project { get; set; }
public int TeamMemberId { get; set; }
[ForeignKey("TeamMemberId")]
[InverseProperty("ProjectMembers")]
public TeamMember TeamMember { get; set; }
}
而它的配置:
public class ProjectMemberConfiguration : EntityTypeConfiguration<ProjectMember>
{
public ProjectMemberConfiguration()
{
HasKey(a => new { a.ProjectId, a.TeamMemberId });
// ProjectMember has 1 project, projects have many projectmember records
HasRequired(a => a.Project)
.WithMany(s => s.ProjectMembers)
.HasForeignKey(a => a.ProjectId)
.WillCascadeOnDelete(true);
}
}
元数据的样子:
我创建与以下客户端这个实体:
manager.createEntity('ProjectMember', { projectId: projectId, teamMemberId: teamMemberId });
所有好为止,然而,当这种实体被保存回如图贝罗它就会在客户端复制服务器(下面的截图显示了在高速缓存后saveChanges
succeeded
达到回调。
问为什么微风复制这个实体虽然它不应该被允许?
编辑
我恢复到微风1.4.8和问题就消失了。 下面是该manager
保存操作后,包含: