Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
4 votes
0 answers
2k views

How do I deserialize a readonly struct with a constructor that takes a readonly struct as an in parameter?

I have a readonly struct (Outer) that has a readonly struct property (Inner) that is passed into the constructor as an in parameter to avoid one copy when the constructor is called. Trying to ...
Jeremy Morton's user avatar
14 votes
3 answers
3k views

How to make readonly structs XML serializable?

I have an immutable struct with only one field: struct MyStruct { private readonly double number; public MyStruct(double number) => this.number = number; } And I want this to be ...
Şafak Gür's user avatar
  • 7,205