diff --git a/src/AutoRest.CSharp/Common/Generation/Writers/ModelReaderWriterContextWriter.cs b/src/AutoRest.CSharp/Common/Generation/Writers/ModelReaderWriterContextWriter.cs index c8edd7b70df..4687430e2ee 100644 --- a/src/AutoRest.CSharp/Common/Generation/Writers/ModelReaderWriterContextWriter.cs +++ b/src/AutoRest.CSharp/Common/Generation/Writers/ModelReaderWriterContextWriter.cs @@ -80,7 +80,7 @@ private static bool IsObsolete(CSharpType type) private IEnumerable CollectBuildableTypes(IEnumerable models) { var buildableTypes = new HashSet(new CSharpTypeNameComparer()); - var visitedTypes = new HashSet(new CSharpTypeNameComparer()); + var visitedTypes = new HashSet(); // for all Resource types, just add them directly to buildableTypes foreach (var resource in models.OfType()) @@ -88,7 +88,7 @@ private IEnumerable CollectBuildableTypes(IEnumerable buildableTypes.Add(resource.Type); } - var modelDictionary = models.OfType().ToDictionary(m => m.Type, m => m, new CSharpTypeNameComparer()); + var modelDictionary = models.OfType().ToDictionary(m => m.Type, m => m); foreach (var model in modelDictionary.Values) { diff --git a/test/TestProjects/Customizations-TypeSpec/src/Generated/Models/CustomizationsInTspContext.cs b/test/TestProjects/Customizations-TypeSpec/src/Generated/Models/CustomizationsInTspContext.cs index 29a2e80212a..7b0e91679ee 100644 --- a/test/TestProjects/Customizations-TypeSpec/src/Generated/Models/CustomizationsInTspContext.cs +++ b/test/TestProjects/Customizations-TypeSpec/src/Generated/Models/CustomizationsInTspContext.cs @@ -14,7 +14,7 @@ namespace CustomizationsInTsp /// Context class which will be filled in by the System.ClientModel.SourceGeneration. /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' /// - [ModelReaderWriterBuildable(typeof(ModelStruct?))] + [ModelReaderWriterBuildable(typeof(ModelStruct))] [ModelReaderWriterBuildable(typeof(ModelToAddAdditionalSerializableProperty))] [ModelReaderWriterBuildable(typeof(ModelToChangeNamespace))] [ModelReaderWriterBuildable(typeof(ModelToMakeInternal))]