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); }
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); }