Exemplo n.º 1
0
 private string GetParamName(PropertyInfo propertyInfo, CommandParamAttribute attribute)
 {
     if (attribute != null && !string.IsNullOrEmpty(attribute.Name))
     {
         return(attribute.Name.ToLower());
     }
     else
     {
         return(propertyInfo.Name.ToLower());
     }
 }
Exemplo n.º 2
0
 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.");
             }
         }
     }
 }