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
There are two problems arising from a struct record:
When Upsert is used with database key generation, the key needs to be injected into the record type; for structs, that requires the record to be a ref parameter, which complicates the signature for everyone etc.
For Get, null is returned for classes when a record isn't found. For structs, the distinction between "not found" and "found but happens to be the default" can't easily be maintained; we can modify the API in various complicated/unfriendly ways to make this possible, but it doesn't seem worth it.
FWIW EF also constrains entity types to be classes (for similar reasons, but also since EF implements change tracking).
We don't believe there's enough need for struct record types, so we'll constrain TRecord to be class.
Activity
[-][MEVD] Constrain TRecord to be class[/-][+].Net: [MEVD] Constrain TRecord to be class[/+]Constrain TRecord to class
Constrain TRecord to class
.Net: Pack of changes from MEVD API review (#11882)