Skip to content

Is it possible to work with immutable types? #529

Answered by danielcweber
xperiandri asked this question in Q&A
Discussion options

You must be logged in to vote

This might work for Id and Label, since these values are on the top-level of a GraphSON vertex, but for everything that's below the "properties" property of a GraphSON vertex, the POCO will already be created and just need to be populated, so there must be setters for these. After all, these are just POCOs. I like immutability as well (everything in Gremlinq is immutable), but when it comes to entities, it's just data, and hopefully no one ever does any threading-sensitive operations on these. I know this doesn't go too well with records (C# nor F#), but this is the current state of things.

Yes you don't need to inherit the base class that comes with ExRam.Gremlinq, but for model creation…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by xperiandri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants