internal static bool AddMemberNameToHashSet(IEdmNamedElement item, HashSetInternal<string> memberNameList, ValidationContext context, EdmErrorCode errorCode, string errorString, bool suppressError) { string name; IEdmSchemaElement edmSchemaElement = item as IEdmSchemaElement; if (edmSchemaElement != null) { name = edmSchemaElement.FullName(); } else { name = item.Name; } string str = name; if (memberNameList.Add(str)) { return true; } else { if (!suppressError) { context.AddError(item.Location(), errorCode, errorString); } return false; } }
private static void CheckForNameError(ValidationContext context, string name, EdmLocation location) { if (EdmUtil.IsNullOrWhiteSpaceInternal(name) || name.Length == 0) { context.AddError( location, EdmErrorCode.InvalidName, Strings.EdmModel_Validator_Syntactic_MissingName); } else if (name.Length > CsdlConstants.Max_NameLength) { context.AddError( location, EdmErrorCode.NameTooLong, Strings.EdmModel_Validator_Syntactic_EdmModel_NameIsTooLong(name)); } else if (!EdmUtil.IsValidUndottedName(name)) { context.AddError( location, EdmErrorCode.InvalidName, Strings.EdmModel_Validator_Syntactic_EdmModel_NameIsNotAllowed(name)); } }
private static void CheckForUnreacheableTypeError(ValidationContext context, IEdmSchemaType type, EdmLocation location) { IEdmType foundType = context.Model.FindType(type.FullName()); if (foundType is AmbiguousTypeBinding) { context.AddError( location, EdmErrorCode.BadAmbiguousElementBinding, Strings.EdmModel_Validator_Semantic_AmbiguousType(type.FullName())); } else if (!foundType.IsEquivalentTo(type)) { context.AddError( location, EdmErrorCode.BadUnresolvedType, Strings.EdmModel_Validator_Semantic_InaccessibleType(type.FullName())); } }
internal abstract void Evaluate(ValidationContext context, object item);