user979331
user979331

Reputation: 11871

ASP.NET expected ; error

I have this line of code:

var defaultResult = $"Enum_{@this.GetType().Name}_{@this}";

but I get this error:

expected ;

How do I fix this? String.Format?

Upvotes: 0

Views: 498

Answers (2)

user6745503
user6745503

Reputation:

String interpolation is supported onward c# 6.0. read here for more

Upvotes: 0

Drew Kennedy
Drew Kennedy

Reputation: 4168

The $ is a feature available in C# 6.0. Make sure you're set to the correct version.

Upvotes: 2

Related Questions