/// <summary> /// Enables processing of the result of an action method by a custom type that inherits from the <see cref="T:System.Web.Mvc.ActionResult"/> class. /// </summary> /// <param name="context">The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data.</param> public override void ExecuteResult(ControllerContext context) { if (!context.Controller.ViewData.ModelState.IsValid) { Failure.ExecuteResult(context); } else { var handler = DependencyResolver.Current.GetService <IFormHandler <T> >(); handler.Handle(Form); Success.ExecuteResult(context); } }
public override void ExecuteResult(ControllerContext context) { if (!context.Controller.ViewData.ModelState.IsValid) { Failure.ExecuteResult(context); return; } var handler = ObjectFactory.GetInstance <IFormHandler <T> >(); handler.Handle(Form); Success.ExecuteResult(context); }