title: Entity Framework: Set Delete Rule with CodeFirst
body: <p>I am using EF4 CTP 5, CodeFirst.</p>
  
  <p>Please see my classes first:</p>
  
  <pre><code>public class Guest
  {
          [Key]
          public Guid GuestID { get; set; }
  
          public Language PreferredLanguage { get; set; }
          public Guid? LanguageID { get; set; }
  }
  
  public class Language
  {
          [Key]
          public Guid LanguageID { get; set; }
  
          [Required(ErrorMessage = "Enter language name")]
          [StringLength(50, ErrorMessage = "Language name is too long")]
          public string LanguageName { get; set; } // in origine language
  }
  </code></pre>
  
  <p>My goal is to set a certain "Delete Rule" for the Guest-Language relationship. When a language is deleted, I <em>do not want</em> to delete the corresponding guests (so <em>NO</em> cascade delete). Instead I want the guest's LanguageID to be "Set NULL".</p>
  
  <p>I was hoping for the fluent API to support me here. But I couldn't find anything helpful besides .WillCascadeOnDelete(bool), which does not provide the options I need. Did I miss anything? Or is this just not implemented in CTP 5? </p>
  
  <p>Thanks for any help!</p>