EF 4.1 Code First cyclical reference issue
===

Hi I'm trying to figure out how to solve this issue with my domain model.
I have made a simplified example of what I'm dealing with - using two parent classes and two child classes.

I have multiple paths from the parents to the children:

 - Parent1 --> Child1
 - Parent1 --> Child2
 - Parent1 --> Parent2 --> Child1
 - Parent2 --> Child1

This gives me the following error: {"The referential relationship will result in a cyclical reference that is not allowed. [ Constraint name = Child1_Parent2 ]"}

I know it is because there is multiple cascade paths, but I don't know how to fix the issue. Can I do it with annotations or do I need to use fluent mapping?

I would like the model to function like this:

 - If Parent1 is deleted: Child1 should be deleted, Child2 should *not* be deleted.
 - If Parent2 is deleted: Parent1 *and* Child1 should be deleted, Child2 should *not* be deleted.
 - If Child1 is deleted: Only Child1 is deleted.
 - If Child2 is deleted: Only Child2 is deleted.

Here are the classes:

**Parent1**

    public class Parent1
    {
        [Key]
        public int Id { get; set; }

        [Required]
        public virtual Parent2 Parent2 { get; set; }

        public virtual ICollection<Child1> Children1 { get; set; }
        public virtual ICollection<Child2> Children2 { get; set; }

        public Parent1()
        {
            Children1 = new List<Child1>();
            Children2 = new List<Child2>();
        }
    }

**Parent2**

    public class Parent2
    {
        [Key]
        public int Id { get; set; }

        public virtual ICollection<Child1> Children1 { get; set; }
        
        public Parent2()
        {
            Children1 = new List<Child1>();
        }
    }

**Child1**

    public class Child1
    {
        [Key]
        public int Id { get; set; }

        [Required]
        public Parent1 Parent1 { get; set; }
        [Required]
        public Parent2 Parent2 { get; set; }
    }

**Child2**

    public class Child2
    {
        [Key]
        public int Id { get; set; }

        public Parent1 Parent1 { get; set; }
    }