title: How do I construct this json string and take its values in the action method? (scenario provided)
body: <p><a href="https://i.stack.imgur.com/l9HDW.png" rel="nofollow noreferrer">image</a></p>
  
  <p>In the image link above I have created a form which can dynamically add more rows of input fields</p>
  
  <p>The values from the input field that are dynamically added are pushed into an array while the values on the green part are place into a javascript object.</p>
  
  <pre><code>reservations.push({ Day:d, Room: r, TimeIn: datetimeIn.toString(), TimeOut: datetimeOut.toString()});//this is assuming that only 1 row of input field was added
  
  var r = JSON.stringify(reservations);
  //There's only 1 course, description, section, datefrom and dateto while there can be many Day, Room, TimeIn, TimeOut.
  var reservation = { CourseCode: courseCode.val(), Description: description.val(), Section: section.val(), DateFrom: dateF, DateTo: dateT, r };
          $.ajax({
              url: '/ReserveSubject',
              type: 'POST',
              data: 'reservation=' + JSON.stringify(reservation),
  </code></pre>
  
  <p>How do I take the values of the json string and create and instance of an object that will take those values</p>
  
  <pre><code>[HttpPost]
  public ActionResult ReserveSubject(string reservation)
  {
      Subject sub = new Subject();
  
      sub.CourseCode = reservation.CourseCode;
      sub.Description = reservationDescription;
      .
      .
      .
      //loop through reservation data from dynamically added rows of input field
      {
          Schedule sch = new Schedule();
          sch.Day = reservation.Day; 
          sch.Room = reservation.Room;
          .
          .
          .
          sub.Schedule.add(sch);
      }
          sub.ScheduleTable = MethodThatWillConvertScheduleListToDatatable(sub.Schedule);
  }
  </code></pre>
  
  <p>Object to instantiate</p>
  
  <pre><code>public class Subject
  {
      string CourseCode { get; set; }
      string Description { get; set; }
      string Section { get; set; }
      string DateFrom { get; set; }
      string DateTo { get; set; }
      List&lt;Schedule&gt; Schedule { get; set; }
      DataTable ScheduleTable { get; set; }
  }
  
  public class Schedule
  {
      string Day { get; set; }
      string Room { get; set; }
      string TimeIn { get; set; }
      string Timeout { get; set; }
  }
  </code></pre>
  
  <p>I have already downloaded NewtonSoft as i think most of your answer will make use of it.</p>