Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow C# records to be used as metadata views #343

Open
kzu opened this issue Oct 12, 2022 · 1 comment
Open

Allow C# records to be used as metadata views #343

kzu opened this issue Oct 12, 2022 · 1 comment

Comments

@kzu
Copy link

kzu commented Oct 12, 2022

Currently, if you try to use a record type as a metadata view, you get the following error:

System.NotSupportedException: 'The type [TYPE] is an unsupported type of metadata view.'

Given how convenient and concise they are, it would be quite handy if the export provider
supported record types as metadata views. It would just need to invoke the constructor
and any init properties as needed.

@kzu kzu changed the title Allow records to be used as metadata views Allow C# records to be used as metadata views Oct 12, 2022
@AArnott
Copy link
Member

AArnott commented Oct 12, 2022

I can't think of a reason why this wouldn't be technically possible. There may be one, but it's a fine idea to pursue. This doesn't seem to unblock any critical scenario though, so as a low priority item, it won't likely get attention from the VS team. If you're interested in submitting a PR, I'd be willing to review and merge it, if it came with adequate automated tests.

AArnott added a commit that referenced this issue Jan 27, 2025
Merge main to microbuild
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants