From 6f20eb9699f1d4843f74f308a19707e3d69327c7 Mon Sep 17 00:00:00 2001 From: jona <93538252+wannkunstbeikor@users.noreply.github.com> Date: Sat, 28 Oct 2023 21:41:58 +0200 Subject: [PATCH] [TypeSdkGenerator] Fixed issue with ObservableCollection namespace --- .../FrostyTypeSdkGenerator/SourceGenerator.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/FrostyTypeSdkGenerator/FrostyTypeSdkGenerator/SourceGenerator.cs b/FrostyTypeSdkGenerator/FrostyTypeSdkGenerator/SourceGenerator.cs index 049260228..19239659d 100644 --- a/FrostyTypeSdkGenerator/FrostyTypeSdkGenerator/SourceGenerator.cs +++ b/FrostyTypeSdkGenerator/FrostyTypeSdkGenerator/SourceGenerator.cs @@ -142,7 +142,7 @@ public partial struct {structContext.Name} {{ public bool Equals({structContext.Name} b) {{ - return {string.Join(" && ", structContext.Fields.Select(static field => field.Type.Contains("global::System.Collections.Generic.ObservableCollection<") ? $"{field.Name}.SequenceEqual(b.{field.Name})" : $"{field.Name} == b.{field.Name}"))}; + return {string.Join(" && ", structContext.Fields.Select(static field => field.Type.Contains("global::System.Collections.ObjectModel.ObservableCollection<") ? $"{field.Name}.SequenceEqual(b.{field.Name})" : $"{field.Name} == b.{field.Name}"))}; }} public override bool Equals(object? obj) @@ -354,7 +354,7 @@ protected override CString GetId() {{ return __id; }} - + if (!string.IsNullOrEmpty({field.Name})) {{ return {field.Name}.Sanitize(); @@ -378,13 +378,13 @@ private static void CreateProperties(SourceProductionContext context, TypeContex public partial {(typeContext.IsValueType ? "struct" : "class")} {typeContext.Name} {{"; bool needsConstructor = - typeContext.Fields.Any(static f => f.Type.Contains("global::System.Collections.Generic.ObservableCollection<")); + typeContext.Fields.Any(static f => f.Type.Contains("global::System.Collections.ObjectModel.ObservableCollection<")); string constructor = string.Empty; foreach (FieldContext field in typeContext.Fields) { if (needsConstructor) { - if (field.Type.Contains("global::System.Collections.Generic.ObservableCollection<")) + if (field.Type.Contains("global::System.Collections.ObjectModel.ObservableCollection<")) { constructor += $"\n {field.Name} = new();"; }