C# Intractive をVisual Studioから使う
Introducing the Visual Studio 'C# REPL'
https://channel9.msdn.com/Events/Visual-Studio/Connect-event-2015/103
https://www.visualstudio.com/news/vs2015-update1-vs で Visual Studio 2015 Update 1 に C# Intractive がはいった。
まだnugetに対応していなし、プロジェクファイルと連携していにけどすぐによくなるだろう(Update2 でもあまり変わってない感じ。。。)。
表示 -> その他のWindow -> C# インタラクティブ で起動して貼り付ける(一応ここでもコード補完が効く)。
Microsoft (R) Roslyn C# コンパイラ バージョン 1.2.0.60425 'CSharpInteractive.rsp' からコンテキストを読み込んでいます。 詳細については、「#help」と入力します。 > #r "C:\Users\udagawa\development\csharp\csharp6-test\csharp6-test-unit\bin\Debug\csharp6-test-unit.dll" > using csharp6_test; . > var sample = new Sample{ id = 1 }; > sample Sample { id=1, name=null } > var sql = $"select {nameof(Sample.name)} from {nameof(Sample)} where {nameof(Sample.id)} = {sample.id}"; > sql "select name from Sample where id = 1" >