Skip to content

Commit f0e605b

Browse files
authored
FIX: Allow numbers in TextBindingResolver (#597)
* Update TextBindingResolverFactory.cs In cases where propertynames contain a number, e.g. "Comment1", they will be excluded from the resolver. The fix allows for all legitemate property names to be binded with the resolver
1 parent fecd3b7 commit f0e605b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Moryx/Bindings/TextBindingResolverFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static class TextBindingResolverFactory
1414
/// Regex for binding.
1515
/// It matches strings of type "Product.Id" or "Recipe".
1616
/// </summary>
17-
private const string BindingRegex = @"\{(?<binding>[A-Z][a-z]+(\.?[A-Z]\w+(?:\[\w+\])?)*)(?<hasFormat>:(?<format>\w+))?\}";
17+
private const string BindingRegex = @"\{(?<binding>([A-Za-z_][A-Za-z0-9_]*)(\[\d+\])?(\.([A-Za-z_][A-Za-z0-9_]*)(\[\d+\])?)*)?(?<hasFormat>:(?<format>\w+))?\}";
1818

1919
/// <summary>
2020
/// Create resolver for this instruction
@@ -110,4 +110,4 @@ public string Resolve(object source)
110110
}
111111
}
112112
}
113-
}
113+
}

0 commit comments

Comments
 (0)