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
Originally posted by JamesTheButler October 30, 2023
Hi everyone!
I am serializing a class that contains a public Action field. Consider the following example:
record class Example
{
public int Int { get; private set; }
public Action? SomeAction;
};
public void Test()
{
var serializer = new SerializerBuilder().Build();
var output = serializer.Serialize(new DemoClass());
// output:
// SomeAction:
// Int: 0
}
SomeAction gets serialized to an empty string in yaml, which is a bit annoying but still okay. It get's fun if we actually subscribe to SomeAction when the serializer generates ~5.000 lines of yaml to describe the attached action.
Is it possible to not serialize members of a given type? I know about [YamlIgnore] but I would rather set up my serializer to ignore all members of the type Action (and possibly other types as well) in any of my serializable classes.
The text was updated successfully, but these errors were encountered:
Discussed in #861
Originally posted by JamesTheButler October 30, 2023
Hi everyone!
I am serializing a class that contains a public
Action
field. Consider the following example:SomeAction
gets serialized to an empty string in yaml, which is a bit annoying but still okay. It get's fun if we actually subscribe toSomeAction
when the serializer generates ~5.000 lines of yaml to describe the attached action.Is it possible to not serialize members of a given type? I know about
[YamlIgnore]
but I would rather set up my serializer to ignore all members of the typeAction
(and possibly other types as well) in any of my serializable classes.The text was updated successfully, but these errors were encountered: