You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MemoryPack has 24 diagnostics rules(`MEMPACK001` to `MEMPACK024`) to be define comfortably.
129
+
MemoryPack has 24 diagnostics rules(`MEMPACK001` to `MEMPACK026`) to be define comfortably.
130
130
131
131
If target type is defined MemoryPack serialization externally and registered, use `[MemoryPackAllowSerialize]` to silent diagnostics.
132
132
@@ -141,6 +141,20 @@ public partial class Sample2
141
141
142
142
Member order is **important**, MemoryPack does not serialize any member-name and other tags, serialize in the declared order. If the type is inherited, serialize in the order of parent → child. Member orders can not change for the deserialization. For the schema evolution, see [Version tolerant](#version-tolerant) section.
143
143
144
+
Default order is sequential but you can choose explicit layout with `[MemoryPackable(SerializeLayout.Explicit)]` and `[MemoryPackOrder()]`.
145
+
146
+
```csharp
147
+
// serialize Prop0 -> Prop1
148
+
[MemoryPackable(SerializeLayout.Explicit)]
149
+
publicpartialclassSampleExplicitOrder
150
+
{
151
+
[MemoryPackOrder(1)]
152
+
publicintProp1 { get; set; }
153
+
[MemoryPackOrder(0)]
154
+
publicintProp0 { get; set; }
155
+
}
156
+
```
157
+
144
158
### Constructor selection
145
159
146
160
MemoryPack supports parameterized constructor not only parameterless constructor. The selection of the constructor follows these rules. Both class and struct follows same.
0 commit comments