/// <summary> /// Adds and compiles a new template using the specified <paramref name="templateSource"/> and returns a <see cref="TemplateRunner{TModel}"/>. /// </summary> /// <typeparam name="TModel">The model type</typeparam> /// <param name="service"></param> /// <param name="templateSource"></param> /// <returns></returns> public static ITemplateRunner <TModel> CompileRunner <TModel>(this IRazorEngineService service, string templateSource) { var name = $"{typeof(TModel).Name}_{Guid.NewGuid()}"; return(service.CompileRunner <TModel>(templateSource, name)); }