/// <summary> /// Gets a value indicating if the schema collection has the specified object type and attribute in its definition /// </summary> /// <param name="types">The schema collection to evaluate</param> /// <param name="objectClass">The name of the object class</param> /// <param name="attribute">The name of the attribute</param> /// <returns>A value indicating if the object class and attribute are both present in the schema</returns> public static bool HasAttribute(this SchemaTypeKeyedCollection types, string objectClass, string attribute) { if (types.Contains(objectClass)) { return(types[objectClass].Attributes.Any(t => t.Name == attribute)); } else { return(false); } }
public static bool HasObjectClass(this SchemaTypeKeyedCollection types, string objectClass) { return(types.Contains(objectClass)); }