/// <summary> /// Renders a template based on a previously compiled assembly reference. This method allows for /// caching assemblies by their assembly Id. /// </summary> /// <param name="assemblyId">Id of a previously compiled assembly</param> /// <param name="context">Optional context object</param> /// <param name="writer">Output writer</param> /// <param name="nameSpace">Namespace for compiled template to execute</param> /// <param name="className">Class name for compiled template to execute</param> /// <returns></returns> protected virtual bool RenderTemplateFromAssembly(string assemblyId, object context, TextWriter writer) { // String result will be empty as output will be rendered into the // Response object's stream output. However a null result denotes // an error string result = Engine.RenderTemplateFromAssembly(assemblyId, context, writer); if (result == null) { ErrorMessage = Engine.ErrorMessage; return(false); } return(true); }
/// <summary> /// Renders a template based on a previously compiled assembly reference. This method allows for /// caching assemblies by their assembly Id. /// </summary> /// <param name="assemblyId">Id of a previously compiled assembly</param> /// <param name="model">Optional model data object</param> /// <param name="writer">Output writer</param> /// <returns></returns> protected virtual bool RenderTemplateFromAssembly(string assemblyId, object model, TextWriter writer) { LastException = null; // String result will be empty as output will be rendered into the // Response object's stream output. However a null result denotes // an error string result = Engine.RenderTemplateFromAssembly(assemblyId, model, writer); if (result == null) { SetErrorException(new RazorHostContainerException(Engine.ErrorMessage, Engine.LastGeneratedCode, Engine.LastException, null, null)); return(false); } return(true); }