I want to get List of All QueryString to Append in the URL the below code works perfectly in asp.net mvc but when I move it to Asp.net Core the second line of the method shows me an error
Cannot convert from Micorosoft.AspNetCore.Http.QueryString to System.Collection.IEqaulityComparer
void IActionFilter.OnActionExecuting(ActionExecutingContext filterContext)
{
var req = filterContext.HttpContext.Request;
var queryStringParams = new NameValueCollection(req.QueryString);
foreach (string x in queryStringParams)
{
if (controllerName.Equals("Company") && queryStringParams.AllKeys.Length > 1)
{
if (x.Equals("typ"))
{
if (!string.IsNullOrEmpty(param))
param = "&" + param;
param = x + "=" + queryStringParams[x];
break;
}
}
if (!string.IsNullOrEmpty(param) && !param.Equals("q"))
{
if (!string.IsNullOrEmpty(param))
param = "&" + param;
param = x + "=" + queryStringParams[x];
}
base.OnActionExecuting(filterContext);
}
}
}
}