/// <summary> /// /// </summary> /// <param name="TemplateString"></param> /// <returns></returns> async protected Task<Type> GetTemplateCodeTypeByStringAsync(String TemplateString) { var TemplateCodeGen = new TemplateCodeGen(TemplateString, this); TemplateCodeGen.OutputGeneratedCode = OutputGeneratedCode; Exception YieldedException = null; var Value = await Task.Run(() => { try { return TemplateCodeGen.GetTemplateCodeType(); } catch (Exception Exception) { YieldedException = Exception; return null; } }); if (YieldedException != null) throw YieldedException; return Value; //return new TemplateCodeGenRoslyn(TemplateString, this).GetTemplateCodeType(); }
protected Type GetTemplateCodeTypeByString(String TemplateString) { var TemplateCodeGen = new TemplateCodeGen(TemplateString, this); TemplateCodeGen.OutputGeneratedCode = OutputGeneratedCode; return TemplateCodeGen.GetTemplateCodeType(); //return new TemplateCodeGenRoslyn(TemplateString, this).GetTemplateCodeType(); }
protected Type GetTemplateCodeTypeByString(String TemplateString) { var TemplateCodeGen = new TemplateCodeGen(TemplateString, this); TemplateCodeGen.OutputGeneratedCode = OutputGeneratedCode; return(TemplateCodeGen.GetTemplateCodeType()); //return new TemplateCodeGenRoslyn(TemplateString, this).GetTemplateCodeType(); }
protected static TemplateCode CompileTemplateCodeByString(String Code) { var TemplateCodeGen = new TemplateCodeGen(Code); TemplateCodeGen.OutputGeneratedCode = true; return TemplateCodeGen.GetTemplateCode(); }