Using C# 7 features inside of a View in an ASP.NET MVC Core project

Could you try the following (recommended by folks on the ASP.NET core team):

  1. Install the Microsoft.CodeAnalysis.CSharp (version 2.0.0) and System.ValueTuple (version 4.3.0) packages
  2. In Startup.cs, in the ConfigureServices method, configure Razor to use C# 7 by doing the following:

    services.AddMvc().AddRazorOptions(options =>
         options.ParseOptions = new CSharpParseOptions(LanguageVersion.CSharp7));