private Tuple <ActionWrapper, NakedObjectSpecification, NakedObjectActionParameter> GetActionParameterTypeInternal(string typeName, string actionName, string parmName) { if (string.IsNullOrEmpty(typeName.Trim()) || string.IsNullOrWhiteSpace(actionName.Trim()) || string.IsNullOrWhiteSpace(parmName.Trim())) { throw new BadRequestNOSException(); } NakedObjectSpecification spec = [email protected]().loadSpecification(typeName); if (spec is NoMemberSpecification) { throw new TypeResourceNotFoundNOSException(typeName); } ActionWrapper action = spec.GetActionLeafNodes().SingleOrDefault(p => p.getId() == actionName); if (action == null) { throw new ActionResourceNotFoundNOSException(actionName); } NakedObjectActionParameter parm = action.GetParameters().SingleOrDefault(p => p.getId() == parmName); if (parm == null) { throw new ActionResourceNotFoundNOSException(parmName); } return(new Tuple <ActionWrapper, NakedObjectSpecification, NakedObjectActionParameter>(action, spec, parm)); }
private static ParameterContext[] GetContextParms(ActionWrapper action, NakedObject target) { NakedObjectActionParameter[] parms = action.GetParameters(target); return(parms.Select(p => new ParameterContext { Action = action, Parameter = p }).ToArray()); }