title: one-zero to many cascade delete
body: <p>I have this model : </p>
  
  <pre><code>    public class FileUpload
  {
      public int FileUploadId { get; set; }
      public string FileName { get; set; }
  
  }
  
  public class Company
  {
      public int CompanyId { get; set; }
      public string Name { get; set; }
  
      public FileUpload Logo { get; set; }
      public int? LogoId { get; set; }
  
      public FileUpload Catalog { get; set; }
      public int? CatalogId { get; set; }
  }
  
  public class Ads
  {
      public int AdsId { get; set; }
      public string Name { get; set; }
  
      public FileUpload Picture { get; set; }
      public int? PictureId { get; set; }
  }
  
  public class TestContext : DbContext
  {
      public DbSet&lt;Company&gt; Companies { get; set; }
      public DbSet&lt;Ads&gt; Adses { get; set; }
      public DbSet&lt;FileUpload&gt; FileUploads { get; set; }
  
      protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
          modelBuilder.Conventions.Remove&lt;PluralizingTableNameConvention&gt;();
          modelBuilder.Entity&lt;Ads&gt;()
              .HasOptional(a =&gt; a.Picture)
              .WithMany()
              .HasForeignKey(a =&gt; a.PictureId)
              .WillCascadeOnDelete();
  
          modelBuilder.Entity&lt;Company&gt;()
             .HasOptional(a =&gt; a.Logo)
             .WithMany()
             .HasForeignKey(a =&gt; a.LogoId)
             .WillCascadeOnDelete();
  
          modelBuilder.Entity&lt;Company&gt;()
             .HasOptional(a =&gt; a.Catalog)
             .WithMany()
             .HasForeignKey(a =&gt; a.CatalogId)
             .WillCascadeOnDelete();
      }
  }
  </code></pre>
  
  <p>this code is not working in EF migration!</p>
  
  <p>I want : 
  - every company has optional Logo or Catalog and every Ads has optional Picture. 
  - the FileUpload record can be deleted directly
  - cascade delete</p>
  
  <p>how to do this?!</p>