I suggest you ...

Add new string literal that contains Razor code (for example between «»)

Is time to move forward from String.Format() and inline conditionals, with the new Roslyn would be awesome if we can use some "kind" of Razor in any C# code

var msg = String.Format("Hi {0} you have won {1} credits", name, creditsWon);

How much better it will be:

var msg = «Hi @name you have won @creditsWon credits»

You can provice intellisense and also an HTML version:

var msg = @«<div style="margin:10px;">Hi @name you have won <b>@creditsWon</b> credits</div>»

That option must be multiline too.

33 votes
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Marcos Meli shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

3 comments

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base