Replacing ViewResultBase with ViewExecutor

Good catch

-----Original Message-----
From: "Ryan Nowak" <notifications@github.com>
Sent: ‎10/‎20/‎2014 6:28 PM
To: "aspnet/Mvc" <Mvc@noreply.github.com>
Cc: "Yishai Galatzer" <yishai_galatzer@yahoo.com>
Subject: Re: [Mvc] Replacing ViewResultBase with ViewExecutor (#1409)

In src/Microsoft.AspNet.Mvc.Core/ActionResults/ViewExecutor.cs:
> +    {
> +        private const int BufferSize = 1024;
> +        private const string ContentType = "text/html; charset=utf-8";
> +
> +        /// <summary>
> +        /// Asynchronously renders the specified <paramref name="view"/> to the response body.
> +        /// </summary>
> +        /// <param name="view">The <see cref="IView"/> to render.</param>
> +        /// <param name="actionContext">The <see cref="ActionContext"/> for the current executing action.</param>
> +        /// <param name="viewData">The <see cref="ViewDataDictionary"/> for the view being rendered.</param>
> +        /// <returns>A <see cref="Task"/> that represents the asychronous rendering.</returns>
> +        public static async Task ExecuteAsync([NotNull] IView view,
> +                                              [NotNull] ActionContext actionContext,
> +                                              [NotNull] ViewDataDictionary viewData)
> +        {
> +            actionContext.HttpContext.Response.ContentType = ContentType;
It might be useful to pull this back into the result. If I wanted to write a result type that returns a 404 + view, then this stops me from being able to reuse this 'utility'
—
Reply to this email directly or view it on GitHub.=