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

Prevent resetting of InMemoryBackingStore when serializing #467

Open
SeverinNauer opened this issue Nov 13, 2024 · 0 comments
Open

Prevent resetting of InMemoryBackingStore when serializing #467

SeverinNauer opened this issue Nov 13, 2024 · 0 comments

Comments

@SeverinNauer
Copy link

Currently the tracked properties in the InMemoryBackingStore get reset when serializing an object. For my purposes I want to create a report of the objects that are going to be sent to the graph api before actually sending them. At the moment this is not easily possible, because I can only serialize them once.

This is a short example of the problem I want to avoid

var group = new Group()
{
	DisplayName = "Test Group"
};
var serialized1 = await group.SerializeAsJsonStringAsync(true);
// {"@odata.type":"#microsoft.graph.group","displayName":"Test Group"}
var serialized2 = await group.SerializeAsJsonStringAsync(true);
// {}

Is there a way to avoid this behaviour?
The only workaround I know is to disable (which is not an option for me) or replace the BackingStore implementation. I'm okay with writing an own implementation of the BackingStore but it feels kind of dirty since I basically need to copy past the InMemoryBackingStore. I'm also not sure if I'm going to run into other troubles down the line if I do this.

@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Kiota Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Triage 🔍
Development

No branches or pull requests

1 participant