I am building a fluent interface and would like to call the code below outside my controller...
return RedirectToAction("Activity");
How would I design this method? I have:
public FluentCommand RedirectOnSuccess(string url)
{
if (IsSuccess)
;// make call here...
return this;
}
Note: IsSuccess is set here:
public FluentCommand Execute()
{
try
{
_command.Execute();
IsSuccess = true;
}
catch (RulesException ex)
{
ex.CopyTo(_ms);
IsSuccess = false;
}
return this;
}
I call my fluent interface:
var fluent = new FluentCommand(new UpdateCommand(param,controller,modelstate)
.Execute()
.RedirectOnSucess("Actionname");