System.Web.Mvc.T4Extensions.GetT4MVCResult C# (CSharp) Method

GetT4MVCResult() public static method

public static GetT4MVCResult ( this result ) : IT4MVCActionResult
result this
return IT4MVCActionResult
        public static IT4MVCActionResult GetT4MVCResult(this ActionResult result) {
            var t4MVCResult = result as IT4MVCActionResult;
            if (t4MVCResult == null) {
                throw new InvalidOperationException("T4MVC was called incorrectly. You may need to force it to regenerate by right clicking on T4MVC.tt and choosing Run Custom Tool");
            }
            return t4MVCResult;
        }

Usage Example

Example #1
0
 public static MvcHtmlString ActionLink <TActionResult>(this HtmlHelper htmlHelper, string linkText, Task <TActionResult> taskResult, IDictionary <string, object> htmlAttributes, string protocol, string hostName, string fragment) where TActionResult : ActionResult
 {
     return(LinkExtensions.RouteLink(htmlHelper, linkText, (string)null, protocol ?? T4Extensions.GetT4MVCResult(taskResult.Result).Protocol, hostName, fragment, T4Extensions.GetRouteValueDictionary(taskResult.Result), htmlAttributes));
 }