"Create" View for parent-child relationship MVC 4
<p>So i have this model:</p>

<pre><code> public class Subthing
 {
     public virtual int SubthingId { get; set; }
     public virtual int ThingId { get; set; }

     public virtual string Name { get; set; }

     public virtual int ParentId { get; set; }
     public virtual Subthing Parent { get; set; }
     public virtual List&lt;Subthing&gt; Childs { get; set; }

     public virtual Thing Thing{ get; set; }
}
</code></pre>

<p>And i want to make a create view for introducing subthings related to subthings. I have this controller:</p>

<pre><code>public ActionResult CriarMoreSubthings(int id)
        {

            var x = db.Subthings.FirstOrDefault(e =&gt; e.SubthingId == id);

            if (x == null)
            {
                return HttpNotFound();
            }

            var subthing = new Subthing()
            {
                ThingId = x.ThingId,
                ParentId = id //(also tried x.SubthingId)
            };

            return View("CriarMoreSubthings", subthing);
        }

        [HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult CriarMoreSubthings(Subthing subthing)
        {
            if (ModelState.IsValid)
            {
                db.Subthings.Add(subthing);
                db.SaveChanges();              
                return RedirectToAction(blabla);
            }

            return View(subthing);
        }
</code></pre>

<p>But it always create with the parentId = 0, but the parentId should be the subthing id. (For the record, it can be all wrong, i already searched a lot about this but i can't make it work, novice here). What am i doing wrong? Thanks</p>