示例#1
0
文件: Skin.cs 项目: dumpvn/minimvc
        public string RenderView(IContext context)
        {
            string text = string.Empty;

            using (Stream writer = new MemoryStream())
            {
                compilationUnit.Execute(context, writer);

                writer.Position = 0;

                using (StreamReader sr = new StreamReader(writer, WebAppConfig.TemplateFileEncoding))
                {
                    text = sr.ReadToEnd();
                }
            }

            return(text);
        }