I'm using .NET Core 2.0.2 to create an ASP.NET webapp in C#.
Everytime I use Request.Url in my controllers, dotnet run outputs an error:
error CS1061: 'HttpRequest' does not contain a definition for 'Url' and no extension method 'Url' accepting a first argument of type 'HttpRequest' could be found
The same thing happens with Request.Params. Even though the .NET documentation says there is a getter for the Params property.
I managed to find a workaround for Request.Url: I use the Request.GetUri() method. However I couldn't find such a replacement for Request.Params.
Here are my using statements:
using System;
using System.Diagnostics;
using area.Models;
using Microsoft.AspNetCore.Identity;
using System.Threading.Tasks;
using Microsoft.ApplicationInsights.AspNetCore.Extensions;
using Microsoft.AspNetCore.Mvc;
using Tweetinvi;
using Tweetinvi.Models;
Why am I getting those errors? Do you know a fix? Otherwise, do you have a workaround to get Request.Params?