Example #1
0
        public ActionResult CSharp(string source)
        {
            var env = new RoslynEnvironment();

            ViewBag.Response = env.Execute(source);
            return(View());
        }
Example #2
0
 public Compilation(IPersistentStorage storage)
 {
     _environment = createEnvironment(storage);
     _scope.set<ICompilerEnvironment>(_environment);
 }
Example #3
0
        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;
        }