title: Entity Framework Cascade Delete Error
body: <p>I'm learning EF, and have an error when trying to create my database. Introducing FOREIGN KEY constraint 'FK_dbo.ApplicationUserBuildings_dbo.Buildings_Building_BuildingID' on table 'ApplicationUserBuildings' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
  Could not create constraint or index. See previous errors.</p>
  
  <p>I understand what this error means, but I don't know exactly what do to in my code to get rid of if.  I believe it's because there's a relationship between users and buildings and divisions and buildings.  Here's my code.  Users can have multiple buildings,  Divisions can also have multiple buildings.  </p>
  
  <pre><code>public class Division : Common.BaseModel
      {
          [Required]
          [Key]
          public int DivisionID { get; set; }
  
          [Required]
          public String Name { get; set; }
  
          public virtual ICollection&lt;Building&gt; Buildings { get; set; }
  
      }
  
  public class Building : Common.BaseModel
      {
          [Required]
          [Key]
          public int BuildingID { get; set; }
  
          [Required]
          public String Name { get; set; }
  
          public int DivisionID { get; set; }
  
          public virtual Division Division { get; set; }
  
          public virtual ICollection&lt;ApplicationUser&gt; ApplicationUsers { get; set; }
  
      }
  
  public class ApplicationUser 
      {
  
          public virtual ICollection&lt;Building&gt; Buildings { get; set; }
  
          public int DivisionID { get; set; }
  
          public virtual Division Divison { get; set; }
      }
  </code></pre>