Are there any plans to add support for records (added in C# 9/.NET 5), more specifically positional records?
well, we'd need to think about what that means, since positional records still have names; do we bind by constructor parameter name (which would be my expectation)? or by ordinal position? what would you expect to happen here?
By name sounds most logical to me. See here on how it can be done.
I'm very familiar; right now, for nominal matching, it needs a parameterless constructor, which means that (if we assume the columns aren't an exact match) this doesn't work:
``` c#
private record PositionalCarRecord(int Age, Car.TrapEnum Trap, string Name)
but this does:
``` c#
private record PositionalCarRecord(int Age, Car.TrapEnum Trap, string Name)
{
public PositionalCarRecord() : this(default, default, default) { }
}
I'll have to look to see how much work is involved in handling the first case.
I did it by name in spanjson, fwiw it was more work to get mixed records (with extra normal properties) to work than the positional stuff.
Additionally https://stackoverflow.com/questions/63097273/c-sharp-9-0-records-reflection-and-generic-constraints might help, but Marc probably already knows about it.