private Template GetTemplate(EmbeddedResource resource) { Func<TextReader> getContentReader = () => new StreamReader(resource.Assembly.GetManifestResourceStream(resource.GetResourceName())); return new Template(resource.GetViewName(), resource.GetPath(), ".", findModelFromViewCollection.FindModelType(getContentReader(), resource.GetViewName()), getContentReader); }
private static Template GetTemplate(EmbeddedResource resource, IEnumerable <Assembly> availableAssemblies) { Func <TextReader> getContentReader = () => { var stream = resource.Assembly.GetManifestResourceStream(resource.GetResourceName()); return(new StreamReader(stream ?? new MemoryStream())); }; return(new Template(resource.GetViewName(), resource.GetPath(), ".", FindModelType(getContentReader(), availableAssemblies), getContentReader)); }