The out var is correct and is available if you use at least C# 7.0. 
This is what the documentation tell about that feature called out variables.
So you need to make sure your project is configured to use at least C# 7 feature by following what is explained in this link.
This is what is explained by the link:
Right-click on the project node in Solution Explorer and select
  Properties. Select the Build tab and select the Advanced button.
  In the dropdown, select the version. The following image shows the
  "latest" setting:
