From 80fa3a69df7183c59cef1072c1a6bcddbab1533d Mon Sep 17 00:00:00 2001 From: Alessandro Asoni Date: Wed, 1 Nov 2023 14:59:17 +0100 Subject: [PATCH 1/2] Add OptIn serialization attribute --- crates/cli/src/subcommands/generate/csharp.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/cli/src/subcommands/generate/csharp.rs b/crates/cli/src/subcommands/generate/csharp.rs index 8913bb6b52..952f504ee4 100644 --- a/crates/cli/src/subcommands/generate/csharp.rs +++ b/crates/cli/src/subcommands/generate/csharp.rs @@ -589,6 +589,7 @@ fn autogen_csharp_product_table_common( writeln!(output, "{{").unwrap(); { indent_scope!(output); + writeln!(output, "[Newtonsoft.Json.JsonObject(Newtonsoft.Json.MemberSerialization.OptIn)]").unwrap(); writeln!(output, "public partial class {name} : IDatabaseTable").unwrap(); writeln!(output, "{{").unwrap(); { From 9c4b969e643692908d771baebebef7595f15654f Mon Sep 17 00:00:00 2001 From: Alessandro Asoni Date: Wed, 1 Nov 2023 17:29:16 +0100 Subject: [PATCH 2/2] Run rust fmt --- crates/cli/src/subcommands/generate/csharp.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/cli/src/subcommands/generate/csharp.rs b/crates/cli/src/subcommands/generate/csharp.rs index 952f504ee4..f9995d0388 100644 --- a/crates/cli/src/subcommands/generate/csharp.rs +++ b/crates/cli/src/subcommands/generate/csharp.rs @@ -589,7 +589,11 @@ fn autogen_csharp_product_table_common( writeln!(output, "{{").unwrap(); { indent_scope!(output); - writeln!(output, "[Newtonsoft.Json.JsonObject(Newtonsoft.Json.MemberSerialization.OptIn)]").unwrap(); + writeln!( + output, + "[Newtonsoft.Json.JsonObject(Newtonsoft.Json.MemberSerialization.OptIn)]" + ) + .unwrap(); writeln!(output, "public partial class {name} : IDatabaseTable").unwrap(); writeln!(output, "{{").unwrap(); {