Skip to content

Commit cf0eed0

Browse files
committed
Update ImportDefinition.cs
1 parent b347c59 commit cf0eed0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/FluentCommand.Import/ImportDefinition.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@ public class ImportDefinition
8484
[JsonPropertyName("validatorKey")]
8585
public string? ValidatorKey { get; set; }
8686

87+
/// <summary>
88+
/// Retrieves a field definition by its name, ignoring case.
89+
/// </summary>
90+
/// <param name="name">The name of the field to retrieve.</param>
91+
/// <returns>
92+
/// The <see cref="FieldDefinition"/> that matches the specified name, or <see langword="null"/> if no matching field is found.
93+
/// </returns>
94+
public FieldDefinition? GetField(string name)
95+
{
96+
return Fields.Find(f => f.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
97+
}
98+
8799
/// <summary>
88100
/// Builds a mapping between import fields and source headers using regular expressions defined in <see cref="Fields"/>.
89101
/// </summary>

0 commit comments

Comments
 (0)