public async Task <IAcidCodeRunner> GetCodeRunner(IAcidCodeCompiler codeCompiler) { codeCompiler = codeCompiler ?? throw new ArgumentNullException(nameof(codeCompiler)); if (!codeCompiler.IsCodeCompiled) { throw new ApplicationException("Compile code first"); } AcidCodeRunner codeRunner = new AcidCodeRunner(codeCompiler, await _codeRepository.GetSettingsAsync()); return(codeRunner); }
public async Task <CodeItem> SaveCompiledCode(IAcidCodeCompiler codeCompiler) { codeCompiler = codeCompiler ?? throw new ArgumentNullException(nameof(codeCompiler)); if (!codeCompiler.IsCodeCompiled) { throw new ApplicationException("Compile code before saving"); } CodeItem codeItem = new CodeItem(); codeItem.CodeText = codeCompiler.CodeText; codeItem.EntryPoint = codeCompiler.EntryPoint; await _codeRepository.SaveCodeItemAsync(codeItem); return(codeItem); }
public AcidCodeRunner(IAcidCodeCompiler codeCompiler, GeneralSiteSettings siteSettings) : this(codeCompiler) { _siteSettings = siteSettings ?? throw new ArgumentNullException(nameof(siteSettings)); }
public AcidCodeRunner(IAcidCodeCompiler codeCompiler) { _codeCompiler = codeCompiler ?? throw new ArgumentNullException(nameof(codeCompiler)); _siteSettings = new GeneralSiteSettings(); }