public override string Execute(string virtualfile, object Model)
        {
            try
            {
                if (!File.Exists(HostingEnvironment.MapPath(virtualfile)))
                {
                    return(String.Format("File {0} don't exist", virtualfile));
                }

                var engine  = new MyRazorEngine(virtualfile, new ModuleInstanceContext(), null);
                var WebPage = engine.DnnWebPage as TemplateWebPage;
                if ((WebPage != null))
                {
                    WebPage.Template = new TemplateHelper(WebPage.VirtualPath);
                }

                var writer = new StringWriter();

                //var model = Reflection.GetProperty(engine.Webpage.GetType(), "Model", engine.Webpage);
                //var member = engine.Webpage.GetType().GetMember("Model")[0];
                //Type t = ((PropertyInfo)member).PropertyType;
                //model = Reflection.CreateInstance(t);

                if (Model == null)
                {
                    engine.Render(writer);
                }
                else
                {
                    Object       obj  = engine.DnnWebPage;
                    PropertyInfo prop = obj.GetType().GetProperty("Model", BindingFlags.Public | BindingFlags.Instance);
                    if (null != prop && prop.CanWrite)
                    {
                        prop.SetValue(obj, Model, null);
                    }
                    //Reflection.SetProperty(t.DeclaringType, "Model", engine.Webpage, new object[] {Model });


                    engine.Render(writer);
                }

                return(writer.ToString());
            }
            catch (Exception ex)
            {
                return(" " + virtualfile + " " + ex.Message + " " + ex.StackTrace);
            }
        }
        public override string Execute(string virtualfile, object Model)
        {
            try
            {
                if (!File.Exists(HostingEnvironment.MapPath(virtualfile)))
                {
                    return String.Format("File {0} don't exist", virtualfile);
                }

                var engine = new MyRazorEngine(virtualfile, new ModuleInstanceContext(), null);
                var WebPage = engine.DnnWebPage as TemplateWebPage;
                if ((WebPage != null))
                {
                    WebPage.Template = new TemplateHelper(WebPage.VirtualPath);
                }

                var writer = new StringWriter();

                //var model = Reflection.GetProperty(engine.Webpage.GetType(), "Model", engine.Webpage);
                //var member = engine.Webpage.GetType().GetMember("Model")[0];
                //Type t = ((PropertyInfo)member).PropertyType;
                //model = Reflection.CreateInstance(t);

                if (Model == null)
                {
                    engine.Render(writer);
                }
                else
                {
                    Object obj = engine.DnnWebPage;
                    PropertyInfo prop = obj.GetType().GetProperty("Model", BindingFlags.Public | BindingFlags.Instance);
                    if (null != prop && prop.CanWrite)
                    {
                        prop.SetValue(obj, Model, null);
                    }
                    //Reflection.SetProperty(t.DeclaringType, "Model", engine.Webpage, new object[] {Model });

                    engine.Render(writer);
                }

                return writer.ToString();
            }
            catch (Exception ex)
            {
                return " " + virtualfile + " " + ex.Message + " " + ex.StackTrace;
            }
        }