|
@@ -1,14 +1,14 @@
|
|
|
# Diagnostics Warning STRDIAG000
|
|
# Diagnostics Warning STRDIAG000
|
|
|
|
|
|
|
|
> There is an Attribute Contradiction on '{0}' Member. `[DataMemberIgnore]` Attribute on a `[DataMember]` is not supported.
|
|
> There is an Attribute Contradiction on '{0}' Member. `[DataMemberIgnore]` Attribute on a `[DataMember]` is not supported.
|
|
|
-Except if it has also `[DataMemberUpdatable]` Attribute.
|
|
|
|
|
|
|
+> Except if it has also `[DataMemberUpdatable]` Attribute.
|
|
|
|
|
|
|
|
## Explanation
|
|
## Explanation
|
|
|
|
|
|
|
|
-Adding `[DataMember]` and `[DataMemberIgnore]` to the same member is not supported. This would be a contradiction.
|
|
|
|
|
-It would mean the Serializer should serialize the member and ignore it at the same time. The `DataMemberUpdatable` attribute makes the combination valid again as it negates the `DataMemberIgnore` for the binary Serializer.
|
|
|
|
|
|
|
+Adding @Stride.Core.DataMemberAttribute and @Stride.Core.DataMemberIgnoreAttribute to the same member is not supported. This would be a contradiction.
|
|
|
|
|
+It would mean the Serializer should serialize the member and ignore it at the same time. The @Stride.Updater.DataMemberUpdatableAttribute makes the combination valid again as it negates the @Stride.Core.DataMemberIgnoreAttribute for the binary Serializer.
|
|
|
|
|
|
|
|
-## Example
|
|
|
|
|
|
|
+## Example: Invalid cases
|
|
|
|
|
|
|
|
The following example generates STRDIAG000 on each property:
|
|
The following example generates STRDIAG000 on each property:
|
|
|
|
|
|
|
@@ -28,8 +28,11 @@ public class STRDIAG000
|
|
|
}
|
|
}
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-There is a special case if the @Stride.Updater.DataMemberUpdatableAttribute is applied.
|
|
|
|
|
-This Attribute negates the @Stride.Core.DataMemberIgnoreAttribute for the binary Serializer, so it becomes valid again.
|
|
|
|
|
|
|
+## Example: Special Case `DataMemberUpdatable`
|
|
|
|
|
+
|
|
|
|
|
+> [!IMPORTANT]
|
|
|
|
|
+> There is a special case if the @Stride.Updater.DataMemberUpdatableAttribute is applied.
|
|
|
|
|
+> This Attribute negates the @Stride.Core.DataMemberIgnoreAttribute for the binary Serializer, so it becomes valid again.
|
|
|
|
|
|
|
|
```csharp
|
|
```csharp
|
|
|
using Stride.Core;
|
|
using Stride.Core;
|
|
@@ -45,7 +48,7 @@ public class STRDIAG000
|
|
|
|
|
|
|
|
## Solution
|
|
## Solution
|
|
|
|
|
|
|
|
-To resolve the warning, pick either the @Stride.Core.DataMemberAttribute or the @Stride.Core.DataMemberIgnoreAttribute.
|
|
|
|
|
|
|
+> To resolve the warning, pick either the @Stride.Core.DataMemberAttribute or the @Stride.Core.DataMemberIgnoreAttribute.
|
|
|
If the `YamlSerializer` and the Editor should ignore the member but the binary Serializer not, then add the @Stride.Core.DataMemberIgnoreAttribute.
|
|
If the `YamlSerializer` and the Editor should ignore the member but the binary Serializer not, then add the @Stride.Core.DataMemberIgnoreAttribute.
|
|
|
|
|
|
|
|
## References
|
|
## References
|