| | |
| | | if (sugarColumn == null) |
| | | return "请配置SugarColumn属性"; |
| | | //忽略与主键的字段不做验证 |
| | | if (property.Name == keyName.FirstLetterToUpper() || (ignoreFields != null && ignoreFields.Contains(property.Name)) || sugarColumn.IsOnlyIgnoreInsert || sugarColumn.IsOnlyIgnoreUpdate || sugarColumn.IsIgnore) |
| | | if (property.Name.ToUpper() == keyName.ToUpper() || (ignoreFields != null && ignoreFields.Contains(property.Name)) || sugarColumn.IsOnlyIgnoreInsert || sugarColumn.IsOnlyIgnoreUpdate || sugarColumn.IsIgnore) |
| | | continue; |
| | | |
| | | //不在编辑中的列,是否也要必填 |
| | | if (!dic.ContainsKey(property.Name.FirstLetterToLower())) |
| | | if (!dic.ContainsKey(property.Name.ToUpper())) |
| | | { |
| | | if (!sugarColumn.IsNullable) |
| | | { |
| | |
| | | } |
| | | continue; |
| | | } |
| | | if(dic[property.Name.FirstLetterToLower()] != null) |
| | | if(dic[property.Name.ToUpper()] != null) |
| | | { |
| | | string str = dic[property.Name.FirstLetterToLower()].ToString(); |
| | | string str = dic[property.Name.ToUpper()].ToString(); |
| | | //将所有空值设置为null |
| | | if (str == string.Empty) |
| | | dic[property.Name.FirstLetterToLower()] = null; |
| | | dic[property.Name.ToUpper()] = null; |
| | | } |
| | | |
| | | } |