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
Proposal: Add a TreatAsString field to QueryAttribute
The proposal arises from the need to pass custom types or structs which might represent types with rules and conversions.
For example:
```csharp
record readonly struct ZipCode(ushort ZipCode) {
public override string ToString() =>
ZipCode.ToString();
}
```
To solve the problem the proposal seeks to add a field to the QueryAttribute called `TreatAsString`.
The new field is used when the query string is created and simply calls the `ToString()` function on a type.
There is a workaround that is not documented. The current workaround is to implement `IFormattable` on the type, which feels redundant if `ToString()` is already implemented on a custom type.
0 commit comments