If you reached this post it’s pretty sure you encountered some problems using C# 7 features in Visual Studio 2017 MVC 5 applications.
After some investigation, I have found a solution. Follow these steps:
Step 1. Open NuGet console and install the next packages:
Step 2. Set up the Properties->Build->Advanced->Language version to C# 7.0
Step 3. Open web.config file and locate compiler language section and update the attribute compileOptions from /langversion:6 to /langversion:7
Good luck!
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="..." warningLevel="4" compilerOptions="/langversion:7 /nowarn:1659;1699;1701" />
...
</compilers>
</system.codedom>