Inheritance: System.Web.Mvc.ControllerContext
Beispiel #1
0
        public override void ExecuteFormat(Type type, object returnValue, FormatterContext formatterContext)
        {
            IViewSelector viewSelector = GlobalConfiguration.Configuration.Services.GetViewSelector();

            var view = viewSelector.SelectView(new ViewLocationContext(formatterContext)
            {
                ActionDescriptor = formatterContext.ActionDescriptor,
                ReturnType = type
            });

            if (returnValue != null)
            {
                view.ViewData.Model = returnValue;
            }

            view.ExecuteResult(formatterContext);
        }
Beispiel #2
0
 public abstract void ExecuteFormat(Type type, object returnValue, FormatterContext formatterContext);
 public override void ExecuteFormat(Type type, object returnValue, FormatterContext formatterContext)
 {
     this.WriteToStream(type, returnValue, formatterContext.HttpContext.Response.OutputStream, formatterContext.Request);
 }