private string GetParamName(PropertyInfo propertyInfo, CommandParamAttribute attribute) { if (attribute != null && !string.IsNullOrEmpty(attribute.Name)) { return(attribute.Name.ToLower()); } else { return(propertyInfo.Name.ToLower()); } }
private void CheckParam(CommandParamAttribute attribute, string name, Dictionary <string, string> param) { if (attribute != null) { if (attribute.Required) { if (!param.ContainsKey(name)) { throw new InstructionExcepton($"param {name} must input."); } } if (attribute.IsNotBlank) { if (!(param.ContainsKey(name) && param[name] != null && param[name].Length > 0)) { throw new InstructionExcepton($"param {name} size must > 0."); } } } }