/// <summary> /// Codes the equals. /// </summary> /// <param name="x">The x.</param> /// <param name="y">The y.</param> /// <returns></returns> public static bool CodeEquals(this ICodeIdentifier x, ICodeIdentifier y) { return(HasValidCode(x) && HasValidCode(y) && StringComparer.OrdinalIgnoreCase.Equals(x.Code, y.Code)); }
/// <summary> /// Determines whether [has valid code]. /// </summary> /// <param name="item">The item.</param> /// <returns> /// <c>true</c> if [has valid code] [the specified item]; otherwise, <c>false</c>. /// </returns> public static bool HasValidCode(this ICodeIdentifier item) { return(!string.IsNullOrWhiteSpace(item?.Code)); }