Passing a predefined Object from View to Controller by form in MVC6
<p>Code in my controller:</p>

<pre><code>    [HttpPost]
    [ValidateAntiForgeryToken]
    public IActionResult CreateRedBlood(Donor donor)
    {
        if (ModelState.IsValid)
        {
            //create
            Blood newBlood = new Blood();
            if(donor != null)
            {
                DateTime todaysdate = DateTime.Now;
                newBlood = new Blood("RBC", donor.ID);
            }
            _context.Blood.Add(newBlood);
            _context.SaveChanges();
</code></pre>

<p>Code in my View:</p>

<pre><code>    &lt;form asp-action="CreateRedBlood" method="post"&gt;
    &lt;div class="form-horizontal"&gt;
        &lt;h4&gt;Make Donation&lt;/h4&gt;
        &lt;hr /&gt;
        &lt;div class="form-group"&gt;
            &lt;input type="submit" value="Make Red Blood Cell Donation"class="btn btn-default" /&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/form&gt;
</code></pre>

<p>Prior to the use of this form the page has got FullDonorDetails from the controller, and uses model.donor.x to get all the useful bits of information out.</p>

<p>What I'd like to do is pass model.donor back into this form, so that when the button is pressed it takes all that handy information and puts it straight back into CreateRedBlood.</p>

<p>Any ideas?
Thanks!</p>

<p>EDIT: Shyju asked for the following. This is the index controller I'm working with to get fullDonorDetails.</p>

<pre><code>        public IActionResult Index(string searchString)
    {
        FullDonorDetails fullDonorDetails = new FullDonorDetails();

        //Get Donor
        Donor emptyDonor = new Donor();
        Donor activeDonor = new Donor();
        if (!string.IsNullOrEmpty(searchString)
                &amp;&amp; searchString.Length == 10)
        {
            activeDonor = _context.Donor.Single(m =&gt; m.NHN == searchString);

            if (activeDonor != null)
            {
                fullDonorDetails.Donor = activeDonor;
            }
            else
            {
                fullDonorDetails.Donor = emptyDonor;
            }
        }

        else
        {
            fullDonorDetails.Donor = emptyDonor;
        }
        //Get History
        List&lt;Blood&gt; donorBloodHistory = new List&lt;Blood&gt;();
        if (activeDonor != emptyDonor)
        {
            //RedBlood
            var BloodHistory = from r in _context.Blood
                                  select r;
            BloodHistory = BloodHistory.Where(s =&gt; s.DonorId.Equals(activeDonor.ID));
            foreach (Blood currentBlood in BloodHistory)
            {
                donorBloodHistory.Add(currentBlood);
            }

            List&lt;Blood&gt; sortedList = donorBloodHistory.OrderBy(o =&gt; o.DateTaken).ToList();
            sortedList.Reverse();
            fullDonorDetails.DonorHistory = sortedList;
        }

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