You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A value that does not convert on a HasConversion<string> property throws FormatException, not ParsingException #219
A single value on a property configured with HasConversion<string>() goes to the (string) constructor of the property type. If the constructor rejects the value, the caller gets the exception of the constructor, not a QueryKit exception:
// WrappedId(string value) : this(int.Parse(value))varconfig=newQueryKitConfiguration(c =>c.Property<WrappedIdRow>(x =>x.Id).HasConversion<string>());rows.ApplyQueryKitFilter("""Id == "abc" """,config).ToList();// System.FormatException: The input string 'abc' was not in a correct format.
The constructor runs inside the expression (Expression.New), so the exception comes when the query runs, not when the filter is parsed. For other types, a value that does not convert throws ParsingException with Value, PropertyName, and TargetType at parse time.
Expected
Id == "abc" throws ParsingException with Value = abc, PropertyName = Id, and TargetType = WrappedId, the same as a list item does after the fix for #217.
Notes
Found while reviewing #218. The fix for #217 handles list items only.
Activity