it:ad:code_first:issues

Error message:

        modelBuilder.Entity<RoutingRule>()
            .HasOptional(m=>m.WorkflowStep)
            .WithMany()
            .HasForeignKey(m=>m.WorkflowStepFK);
            
            
                    //IsRequired
    public virtual int WorkflowStepFK { get; set; }
    public virtual WorkflowStep WorkflowStep { get; set; }
    
    
    \tSystem.Data.Entity.Edm.EdmAssociationType: : Multiplicity conflicts with the referential constraint in Role 'RoutingRule_WorkflowStep_Target' in relationship 'RoutingRule_WorkflowStep'. Because all of the properties in the Dependent Role are non-nullable, multiplicity of the Principal Role must be '1'.

Solution is:

  • /home/skysigal/public_html/data/pages/it/ad/code_first/issues.txt
  • Last modified: 2023/11/04 22:22
  • by 127.0.0.1