Skip to content

Commit

Permalink
defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaPiggy committed Aug 31, 2024
1 parent e637f94 commit 651f8d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Winch.Examples/ExampleItems/ExampleItemsSaveData.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Newtonsoft.Json;
using System;
using System.ComponentModel;

namespace ExampleItems
{
Expand All @@ -9,9 +10,11 @@ public class ExampleItemsSaveData
[JsonIgnore, NonSerialized] // Can use either one
public string nonSerialized = "Test";

[DefaultValue("Test")]
public string serialized = "Test";

[JsonProperty("property")] // Must have this or else this property will act as non serialized automatically
public string Property { get; set; }
[DefaultValue("Test")]
public string Property { get; set; } = "Test";
}
}

0 comments on commit 651f8d3

Please sign in to comment.