title: asp.net: How do I combine two models together to be able to create a Parent and all of its child entities?
body: <p>I am new to use ASP.net and MVC and in need of some help.I am currently working on a project which is an online recipe book, and I have various tables but the two tables I want to combine into one view is Recipe and RecipeIngredients, as shown below:</p>
  
  <p><strong>Recipe.cs</strong></p>
  
  <pre><code>    namespace TheOnlineFoodBook.Models
      {
          public class Recipe
          {
              [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
              public int RecipeID { get; set; }
              [Display(Name = "Recipe")]
              public string RecipeName { get; set; }
              [Display(Name= "Cuisine")]
              public int CuisineID { get; set; }
              public string Directions { get; set; }
              [Display(Name = "Preperation Time:")]
              public double PreperationTime { get; set; }
              [Display(Name = "Cooking Time:")]
              public double CookingTime { get; set; }
  
  
              public virtual List&lt;RecipeIngredient&gt; RecipeIngredients { get; set; }
  
              [ForeignKey("CuisineID")]
              public virtual Cuisine Cuisine { get; set; }
          }
      }
  </code></pre>
  
  <p><strong>RecipeIngredient.cs</strong></p>
  
  <pre><code>    public class RecipeIngredient
      {
          [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
          public int ID { get; set; }
          public int RecipeID { get; set; }
          public int IngredientID { get; set; }
          public double Quantity { get; set; }
          public int MeasurementID { get; set; }
          public string Notes { get; set; }
  
          public virtual Recipe Recipe { get; set; }
          public virtual Measurement Measurement { get; set; }
          public virtual Ingredient Ingredient { get; set; }
      }
  }
  </code></pre>
  
  <p>I've read a little about combining models to create a viewModel but i'm not sure how I would go about doing this, and I also want to be able to add multiple RecipeIngredients entries at the same time when creating a Recipe. Currently I have the basic CRUD views working which entity framework created for me.</p>