public ActionResult CSharp(string source) { var env = new RoslynEnvironment(); ViewBag.Response = env.Execute(source); return(View()); }
public Compilation(IPersistentStorage storage) { _environment = createEnvironment(storage); _scope.set<ICompilerEnvironment>(_environment); }
protected virtual RoslynEnvironment createEnvironment(IPersistentStorage storage) { var result = new RoslynEnvironment(_scope, storage); result.dependency<object>(new[] { "System", "System.Collections", "System.Collections.Generic" }); result.dependency<IEnumerable<object>>(new[] { "System.Collections", "System.Collections.Generic" }); return result; }