Friday, April 3, 2020

A .NET Framework ApiController just becomes a Controller in .NET Core.

Request.GetQueryNameValuePairs() is instead in .NET Core Request.Query.ToDictionary(q => q.Key, q => q.Value) and along similar lines you could also have something like so:

public IList<KeyValuePair<string, string>> GetQueryString(HttpRequestMessage x)
{
   Dictionary<string, string> y = x.Properties.ToDictionary(q => q.Key,
         q => q.Value.ToString());
   return y.ToList();
}

 
 

Also: IHttpActionResult became IActionResult and there is no more HttpConfiguration.

No comments:

Post a Comment