-
Notifications
You must be signed in to change notification settings - Fork 524
Open
Labels
Milestone
Description
Is your feature request related to a problem? Please describe.
Currently when invoking Select() for records, an exception is thrown
"Constructor invocation is not supported., Windows/10.0.19045 cosmos-netstandard-sdk/3.29.4"
Describe the solution you'd like
Support constructors to select the members specified in constructors and let the deserializer handle the rest.
Describe alternatives you've considered
There are no alternatives except to not use records or not use LINQ.
Additional context
Example:
// record
record UserRecord(string Id)
{
public string? Name { get; set; }
}
// query:
query.Select(x => new UserRecord(x.id, x.Name));could result in
SELECT c.id as Id, c.Name
FROM cwhich yields
[
{ "Id": "12345", "Name": "Joe" }
]and skips potentially large JSON properties
Reactions are currently unavailable