public override bool Validate(out Dictionary <string, string> errors) { errors = new Dictionary <string, string>(); if (string.IsNullOrEmpty(fieldName)) { errors.Add(nameof(FieldName), "Field name is mandatory."); } if (FieldName.HasTrailingSpaces()) { errors.Add(nameof(FieldName), "Trailing spaces are not allowed."); } return(errors.Count == 0); }
public override bool Validate(out Dictionary <string, string> errors) { errors = new Dictionary <string, string>(); if (string.IsNullOrEmpty(fieldName)) { errors.Add(nameof(FieldName), "Field name is mandatory."); } if (string.IsNullOrEmpty(tableName)) { errors.Add(nameof(TableName), "Table name is mandatory."); } if (string.IsNullOrEmpty(dbType)) { errors.Add(nameof(DBType), "DBType name is mandatory."); } if (string.IsNullOrEmpty(englishCaption)) { errors.Add(nameof(EnglishCaption), "English caption is mandatory."); } if (TableName.HasTrailingSpaces()) { errors.Add(nameof(TableName), "Trailing spaces are not allowed."); } if (EnglishCaption.HasTrailingSpaces()) { errors.Add(nameof(EnglishCaption), "Trailing spaces are not allowed."); } if (GreekCaption.HasTrailingSpaces()) { errors.Add(nameof(GreekCaption), "Trailing spaces are not allowed."); } if (FieldName.HasTrailingSpaces()) { errors.Add(nameof(FieldName), "Trailing spaces are not allowed."); } return(errors.Count == 0); }