/// <summary> /// Returns true, if the given entity partially matches the current entity (catalog item). /// </summary> /// <param name="entityName">The given entity name.</param> /// <param name="keyValues">The given key and value pairs.</param> /// <returns>True, if the given entity partially matches the current entity (catalog item).</returns> public bool IsMatch(string entityName, Dictionary <string, string> keyValues) { if (!EntityName.Equals(entityName)) { return(false); } foreach (var keyValue in keyValues) { if (!PrimaryKeyValues.Contains(keyValue)) { return(false); } } return(true); }
/// <summary> /// Returns true, if the given entity identifiers are equal. /// </summary> /// <param name="entityName">The given entity name.</param> /// <param name="entityPrimaryKeyValues">The given primary key values.</param> /// <returns>True, if the given entity identifiers are equal.</returns> public bool IsEqual(string entityName, List <string> entityPrimaryKeyValues) { if (!EntityName.Equals(entityName)) { return(false); } for (int i = 0; i < PrimaryKeyValues.Count; i++) { if (!PrimaryKeyValues.ElementAt(i).Equals(entityPrimaryKeyValues.ElementAt(i))) { return(false); } } return(true); }