private void Invoke(ICall call) { if (_rip.GetCommand(call.Command) is not ICommand c) { Sender.Tell(BuildError(RIPErrors.CommandNotFound, call.Command)); return; } if (c.Actions.FirstOrDefault(e => e.Name.EqualIgnoreCase(call.Action)) is not IAction a) { Sender.Tell(BuildError(RIPErrors.ActionNotFound, call.Action)); return; } var response = Execute(call, c, a); if (a.ReturnType.Equals(GetVoidName())) { Sender.Tell(Response.Success(), Self); } else { Sender.Tell(Response.Success(response), Self); } }
public string Detail(string name) { if (_rip.GetCommand(name) is not ICommand c) { return("Can't find command for name: " + name); } return(BuildCommandDetail(c)); }