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

[FEATURE REQ] Add compatibility for ModelReaderWriter + Collections + AOT #48292

Open
8 tasks
m-nash opened this issue Feb 13, 2025 · 0 comments
Open
8 tasks
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. System.ClientModel Base Core library

Comments

@m-nash
Copy link
Member

m-nash commented Feb 13, 2025

Library name

System.ClientModel

Please describe the feature.

Right now if you want to read or write an IPersistableModel<T> you can simply send it to ModelReaderWriter.Write or ModelReaderWriter.Read and specify the format you want for xml vs json etc.

This does not work with collections of IPersistableModel<T> since when using AOT as well we won't be able to use reflection to create all the collections.

To fix this we will be introducing a new overload to Read which will take in a context which will allow the construction to happen without relying on reflection and be fully compatible with AOT. The old Read overload will get the RequiresUnreferencedCode attribute which means although it will still work in non AOT cases it won't be compatible with AOT.

@github-actions github-actions bot added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Feb 13, 2025
@m-nash m-nash added Client This issue points to a problem in the data-plane of the library. System.ClientModel Base Core library and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Feb 13, 2025
@m-nash m-nash self-assigned this Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. System.ClientModel Base Core library
Projects
None yet
Development

No branches or pull requests

1 participant