예제 #1
0
        private Response RenderView(string name, dynamic model, NancyContext context)
        {
            var fullName = string.Concat(name, ".sshtml");
            var stream = GetBodyStream(fullName);
            var location = GetViewLocationResult(fullName, stream);
            var cache = new DefaultViewCache(this.environment);

            context.Items.Add(CsrfToken.DEFAULT_CSRF_KEY, "DIAGNOSTICSTOKEN");

            var renderContext =
                new DefaultRenderContext(ViewResolver, cache, new DummyTextResource(), new ViewLocationContext() { Context = context });

            return Engine.RenderView(location, model, renderContext);
        }
예제 #2
0
        private Response RenderView(string name, dynamic model, NancyContext context)
        {
            var fullName = string.Concat(name, ".cshtml");

            var stream = GetBodyStream(fullName);

            var location = GetViewLocationResult(fullName, stream);

            var cache = new DefaultViewCache();

            var renderContext =
                new DefaultRenderContext(ViewResolver, cache, new ViewLocationContext() { Context = context });

            return Engine.RenderView(location, model, renderContext);
        }
예제 #3
0
        private Response RenderView(string name, dynamic model, NancyContext context)
        {
            var fullName = string.Concat(name, ".sshtml");
            var stream   = GetBodyStream(fullName);
            var location = GetViewLocationResult(fullName, stream);
            var cache    = new DefaultViewCache(this.environment);

            context.Items.Add(CsrfToken.DEFAULT_CSRF_KEY, "DIAGNOSTICSTOKEN");

            var renderContext =
                new DefaultRenderContext(ViewResolver, cache, new DummyTextResource(), new ViewLocationContext()
            {
                Context = context
            });

            return(Engine.RenderView(location, model, renderContext));
        }