/// <summary> /// Gets a string which represents the current rule identifier. /// </summary> /// <returns>A human-readable string.</returns> public override string ToString() { var properties = new Dictionary <string, string> { { "Type", RuleType.FullName }, { "Name", RuleName }, { "Validated type", ValidatedType.FullName }, { "Validated identity", ObjectIdentity?.ToString() }, } .Where(x => x.Value != null) .ToDictionary(x => x.Key, x => x.Value); var longestKey = GetLongestKey(properties); return(String.Join(Environment.NewLine, properties.Select(prop => String.Concat(FormatKey(prop.Key, longestKey), prop.Value)))); }