title: Upgrading to net core 3.1 - removal of [System.Web.Http.FromBody] breaks ajax response
body: <p>[System.Web.Http.FromBody]  doesn't seem to exist in net core, and it seems like it was instrumental in making this ajax response work in asp net mvc.</p>
  <p>Here's the Ajax:</p>
  <pre><code>    $(document).on('click', '#txtBanishedPersonAlias', function (e) {
  
          e.preventDefault();
  
          var token = $('input[name=__RequestVerificationToken]').val();
  
          var varModel = {};
          varModel.BanishedAlias = $(&quot;#txtAliasEntry&quot;).val();
          varModel.BanishedPersonId = $(&quot;#BanishedPerson_Id&quot;).val();
  
  
          $.ajax({
              url: serverRoot + &quot;/Webforms/SaveBanishedPersonAlias&quot;,
              method: &quot;POST&quot;,
              responseType: 'json',
              data: {
                  __RequestVerificationToken: token,
                  model: varModel,
  
              },
              success: function (data) {
  
                  for (var i = 0; i &lt; data.length; i++) {
  
                      $(&quot;#InsertAliasList&quot;).append(&quot;&lt;p class=\&quot;tempFileListItem\&quot; style=\&quot;color:black\&quot;&gt;&quot; + data[i].BanishedAlias + &quot;&lt;/p&gt;&quot;);
  
                  };
  
                  console.log(JSON.stringify(data));
                  //alert(JSON.stringify(data));
              },
              error: function () {
                  alert(&quot;There has been an error.  Please grab a screenshot and contact the LIBC Help Desk.&quot;);
              }
          })
      });
  </code></pre>
  <p>Here's the Controller:</p>
  <pre><code>    [HttpPost]
      [ValidateAntiForgeryToken]
      [Authorize(Roles = &quot;Admin, AADUser&quot;)]
      public async Task&lt;ActionResult&gt; SaveBanishedPersonAliasAsync([System.Web.Http.FromBody] BanishedPersonAlias model)
      {
  
          // Gets Logged in User's info from the Registered user.
          var user = await _userManager.GetUserAsync(User);
  
          model.SubmitterId = user.Id;
  
  
          if (ModelState.IsValid)
          {
  
              if (model.Id == 0)
              {
                  _dbcontext.BanishedPersonAlias.Add(model);
              }
  
              _dbcontext.SaveChanges();
  
          }
  
          // linq example for returning a single column of children.
          // Remember that error occurs if selecting the virtual property of the Parent Reference.
          var queryAliases =
              from bpa in _dbcontext.BanishedPersonAlias
              where bpa.BanishedPersonId == model.BanishedPersonId
              orderby bpa.BanishedAlias ascending
              //select bpa.BanishedAlias;
  
              // Example of selecting multiple columns to pass back to the view.
              select new { bpa.BanishedAlias, bpa.BanishedPersonId };
  
          return Json(queryAliases);
  
      }
  </code></pre>
  <p>Without the [System.Web.Http.FromBody], the controller correctly enters the new entry into the db, but the response on the page shows as &quot;undefined.&quot;</p>
  <p>On inspection of the Response, though, i see all of the proper results - [{&quot;banishedAlias&quot;:&quot;f&quot;,&quot;banishedPersonId&quot;:1006},{&quot;banishedAlias&quot;:&quot;fff&quot;,&quot;banishedPersonId&quot;:1006},{&quot;banishedAlias&quot;:&quot;fffe&quot;,&quot;banishedPersonId&quot;:1006},{&quot;banishedAlias&quot;:&quot;testalias1&quot;,&quot;banishedPersonId&quot;:1006},{&quot;banishedAlias&quot;:&quot;testalias2&quot;,&quot;banishedPersonId&quot;:1006}]</p>