Skip to content

.Net: [MEVD] Constrain TRecord to be class #11880

Closed
Closed

Description

@roji

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

  1. added
    .NETIssue or Pull requests regarding .NET code
    BuildFeatures planned for next Build conference
    msft.ext.vectordataRelated to Microsoft.Extensions.VectorData
    on May 4, 2025
  2. changed the title [-][MEVD] Constrain TRecord to be class[/-] [+].Net: [MEVD] Constrain TRecord to be class[/+] on May 4, 2025
  3. moved this to Sprint: Planned in Semantic Kernelon May 4, 2025
  4. added a commit that references this issue on May 4, 2025
    719cce8
  5. moved this from Sprint: Planned to Sprint: In Review in Semantic Kernelon May 4, 2025
  6. added 2 commits that reference this issue on May 5, 2025
    de61b89
    472e1d5
  7. moved this from Sprint: In Review to Sprint: Done in Semantic Kernelon May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

.NETIssue or Pull requests regarding .NET codeBuildFeatures planned for next Build conferencemsft.ext.vectordataRelated to Microsoft.Extensions.VectorData

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions