curlysemi / R4Mvc5

R4MVC5 is a Roslyn code generator for ASP.NET MVC5 apps that creates strongly typed helpers that eliminate the use of literal strings in many places
Apache License 2.0
1 stars 0 forks source link

FileResult #7

Closed curlysemi closed 5 years ago

curlysemi commented 5 years ago

There's some "contentType cannot be null" error right now in the current R4Mvc5 for actions that say the return type is FileResult.

(Need to refer to a T4MVC generated FileResult to fix)

As a work-around, just change the returned type in the function signature to ActionResult.

curlysemi commented 5 years ago

This is what T4MVC generated:

internal partial class T4MVC_System_Web_Mvc_FileResult : System.Web.Mvc.FileResult, IT4MVCActionResult
{
    public T4MVC_System_Web_Mvc_FileResult(string area, string controller, string action, string protocol = null): base(" ")
    {
        this.InitMVCT4Result(area, controller, action, protocol);
    }

    protected override void WriteFile(System.Web.HttpResponseBase response) { }

    public string Controller { get; set; }
    public string Action { get; set; }
    public string Protocol { get; set; }
    public RouteValueDictionary RouteValueDictionary { get; set; }
}

We need to change that null it to a " ".

curlysemi commented 5 years ago

Fixed in 4f48a7aa6cc48b9da6e9fa9327f0ee36a977945f.