From 2e22fdee1e254ebd8d567c53d70d476aac17b2f9 Mon Sep 17 00:00:00 2001 From: Stefan Ossendorf Date: Wed, 12 Mar 2025 22:04:31 +0100 Subject: [PATCH] Csla.Generator.AutoImplementProperties.* nullable aware #1233 --- ...plementProperties.Attributes.CSharp.csproj | 2 + .../Discovery/DefinitionExtractionContext.cs | 16 +++---- .../Discovery/PropertyDefinitionExtractor.cs | 14 +++--- .../Discovery/TypeDefinitionExtractor.cs | 47 +++++++++---------- .../ExtractedAttributeDefinition.cs | 12 ++--- .../ExtractedMemberTypeDefinition.cs | 8 ++-- .../ExtractedPropertyDefinition.cs | 12 ++--- .../AutoImplement/ExtractedTypeDefinition.cs | 23 ++++----- .../AutoImplement/GenerationResults.cs | 7 ++- ...AutoImplementInterfacePartialsGenerator.cs | 2 +- ...utoImplementPropertiesPartialsGenerator.cs | 2 +- .../SerializationPartialBuilder.cs | 2 - ...ator.AutoImplementProperties.CSharp.csproj | 6 +++ 13 files changed, 77 insertions(+), 76 deletions(-) diff --git a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.Attributes.CSharp/Csla.Generator.AutoImplementProperties.Attributes.CSharp.csproj b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.Attributes.CSharp/Csla.Generator.AutoImplementProperties.Attributes.CSharp.csproj index 564940a9b9..dae719fd12 100644 --- a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.Attributes.CSharp/Csla.Generator.AutoImplementProperties.Attributes.CSharp.csproj +++ b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.Attributes.CSharp/Csla.Generator.AutoImplementProperties.Attributes.CSharp.csproj @@ -15,6 +15,8 @@ false ..\..\..\..\..\Bin ..\..\..\..\..\bin\packages\ + enable + nullable diff --git a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/Discovery/DefinitionExtractionContext.cs b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/Discovery/DefinitionExtractionContext.cs index 0aa6ab73cd..74ac4f46c9 100644 --- a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/Discovery/DefinitionExtractionContext.cs +++ b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/Discovery/DefinitionExtractionContext.cs @@ -33,9 +33,7 @@ internal class DefinitionExtractionContext(SemanticModel _semanticModel, bool _a /// The namespace in which the type is declared, or an empty string if it is global public string GetTypeNamespace(TypeDeclarationSyntax typeDeclarationSyntax) { - INamedTypeSymbol typeSymbol; - - typeSymbol = _semanticModel.GetDeclaredSymbol(typeDeclarationSyntax) as INamedTypeSymbol; + var typeSymbol = _semanticModel.GetDeclaredSymbol(typeDeclarationSyntax) as INamedTypeSymbol; if (typeSymbol is null || typeSymbol.ContainingNamespace is null) return string.Empty; return typeSymbol.ContainingNamespace.ToString(); } @@ -47,7 +45,7 @@ public string GetTypeNamespace(TypeDeclarationSyntax typeDeclarationSyntax) /// The namespace in which the type is declared, or an empty string if it is global public string GetTypeNamespace(TypeSyntax typeSyntax) { - INamedTypeSymbol typeSymbol; + INamedTypeSymbol? typeSymbol; if (typeSyntax is NullableTypeSyntax nullableTypeSyntax) { typeSyntax = nullableTypeSyntax.ElementType; @@ -141,14 +139,14 @@ private bool IsMatchingTypeSymbol(INamedTypeSymbol appliedAttributeSymbol, strin /// Boolean true if the type is decorated with the attribute, otherwise false private bool IsPropertyDecoratedWith(PropertyDeclarationSyntax propertyDeclaration, string desiredAttributeTypeName, string desiredAttributeTypeNamespace) { - INamedTypeSymbol appliedAttributeSymbol; - foreach (AttributeSyntax attributeSyntax in propertyDeclaration.AttributeLists.SelectMany(al => al.Attributes)) { - appliedAttributeSymbol = _semanticModel.GetTypeInfo(attributeSyntax).Type as INamedTypeSymbol; - if (IsMatchingTypeSymbol(appliedAttributeSymbol, desiredAttributeTypeName, desiredAttributeTypeNamespace)) + if (_semanticModel.GetTypeInfo(attributeSyntax).Type is INamedTypeSymbol appliedAttributeSymbol) { - return true; + if (IsMatchingTypeSymbol(appliedAttributeSymbol, desiredAttributeTypeName, desiredAttributeTypeNamespace)) + { + return true; + } } } return false; diff --git a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/Discovery/PropertyDefinitionExtractor.cs b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/Discovery/PropertyDefinitionExtractor.cs index 368855abad..70cd295de4 100644 --- a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/Discovery/PropertyDefinitionExtractor.cs +++ b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/Discovery/PropertyDefinitionExtractor.cs @@ -35,14 +35,16 @@ public static ExtractedPropertyDefinition ExtractPropertyDefinition(DefinitionEx Setter = HasSetter(propertyDeclaration), SetterModifiers = GetSetterModifiers(propertyDeclaration), Modifiers = GetPropertyModifiers(propertyDeclaration), - Partial = IsPartial(propertyDeclaration) + Partial = IsPartial(propertyDeclaration), + TypeDefinition = new ExtractedMemberTypeDefinition + { + TypeName = GetPropertyTypeName(propertyDeclaration), + TypeNamespace = extractionContext.GetTypeNamespace(propertyDeclaration.Type), + Nullable = GetFieldTypeNullable(propertyDeclaration) + } }; propertyDefinition.AttributeDefinitions.AddRange(GetPropertyAttributes(propertyDeclaration, extractionContext)); - propertyDefinition.TypeDefinition.TypeName = GetPropertyTypeName(propertyDeclaration); - propertyDefinition.TypeDefinition.TypeNamespace = extractionContext.GetTypeNamespace(propertyDeclaration.Type); - propertyDefinition.TypeDefinition.Nullable = GetFieldTypeNullable(propertyDeclaration); - return propertyDefinition; } @@ -173,7 +175,7 @@ private static string[] GetSetterModifiers(PropertyDeclarationSyntax propertyDec .Select(m => m.ToString()) .ToArray(); - return setterModifiers; + return setterModifiers ?? []; } #endregion diff --git a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/Discovery/TypeDefinitionExtractor.cs b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/Discovery/TypeDefinitionExtractor.cs index ba70c7a8ba..3520afe0c9 100644 --- a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/Discovery/TypeDefinitionExtractor.cs +++ b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/Discovery/TypeDefinitionExtractor.cs @@ -30,12 +30,15 @@ public static ExtractedTypeDefinition ExtractTypeDefinitionForInterfaces(Definit .SelectMany(al => al.Attributes) .FirstOrDefault(a => a.Name.ToString().StartsWith(DefinitionExtractionContext.CslaImplementPropertiesAttribute)); - if (attribute != null) + if (attribute?.Name is GenericNameSyntax genericName) { - var genericName = attribute.Name as GenericNameSyntax; // Get the generic argument of the attribute - var genericArgument = genericName?.TypeArgumentList?.Arguments.FirstOrDefault(); + var genericArgument = genericName.TypeArgumentList?.Arguments.FirstOrDefault(); + if (genericArgument is null) + { + return extractedTypeDefinition; + } // Get the type symbol of the generic argument var semanticModel = extractionContext.SemanticModel; @@ -82,25 +85,24 @@ public static ExtractedTypeDefinition ExtractTypeDefinitionForInterfaces(Definit /// ExtractedTypeDefinition containing the data extracted from the syntax tree public static ExtractedTypeDefinition ExtractTypeDefinition(DefinitionExtractionContext extractionContext, TypeDeclarationSyntax targetTypeDeclaration) { - ExtractedTypeDefinition definition = new ExtractedTypeDefinition(); - StringBuilder fullyQualifiedNameBuilder = new StringBuilder(); - - definition.TypeName = GetTypeName(targetTypeDeclaration); - definition.TypeKind = GetTypeKind(targetTypeDeclaration); - definition.Namespace = GetNamespace(targetTypeDeclaration); - definition.Scope = GetScopeDefinition(targetTypeDeclaration); - definition.BaseClassTypeName = GetBaseClassTypeName(extractionContext, targetTypeDeclaration); - definition.DefaultPropertyModifiers = ["public"]; - definition.DefaultPropertySetterModifiers = []; + var typeName = GetTypeName(targetTypeDeclaration); + ExtractedTypeDefinition definition = new ExtractedTypeDefinition + { + TypeName = typeName, + TypeKind = GetTypeKind(targetTypeDeclaration), + Namespace = GetNamespace(targetTypeDeclaration), + Scope = GetScopeDefinition(targetTypeDeclaration), + BaseClassTypeName = GetBaseClassTypeName(extractionContext, targetTypeDeclaration), + DefaultPropertyModifiers = ["public"], + DefaultPropertySetterModifiers = [], + FullyQualifiedName = typeName + }; foreach (ExtractedPropertyDefinition propertyDefinition in PropertyDefinitionsExtractor.ExtractPropertyDefinitions(extractionContext, targetTypeDeclaration)) { definition.Properties.Add(propertyDefinition); } - fullyQualifiedNameBuilder.Append(definition.TypeName); - definition.FullyQualifiedName = fullyQualifiedNameBuilder.ToString(); - return definition; } @@ -119,12 +121,7 @@ private static string GetBaseClassTypeName(DefinitionExtractionContext extractio var targetTypeSymbol = extractionContext.SemanticModel.GetDeclaredSymbol(targetTypeDeclaration) as INamedTypeSymbol; var baseTypeSymbol = targetTypeSymbol?.BaseType; - if (baseTypeSymbol != null) - { - return baseTypeSymbol.Name; - } - - return null; + return baseTypeSymbol?.Name ?? string.Empty; } #endregion @@ -144,13 +141,11 @@ private static string GetNamespace(TypeDeclarationSyntax targetTypeDeclaration) // Get the containing syntax node for the type declaration // (could be a nested type, for example) - SyntaxNode potentialNamespaceParent = targetTypeDeclaration.Parent; + SyntaxNode? potentialNamespaceParent = targetTypeDeclaration.Parent; // Keep moving "out" of nested classes etc until we get to a namespace // or until we run out of parents - while (potentialNamespaceParent != null && - potentialNamespaceParent is not NamespaceDeclarationSyntax - && potentialNamespaceParent is not FileScopedNamespaceDeclarationSyntax) + while (potentialNamespaceParent != null && potentialNamespaceParent is not NamespaceDeclarationSyntax && potentialNamespaceParent is not FileScopedNamespaceDeclarationSyntax) { potentialNamespaceParent = potentialNamespaceParent.Parent; } diff --git a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/ExtractedAttributeDefinition.cs b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/ExtractedAttributeDefinition.cs index e2f69feaf4..2223ba4de3 100644 --- a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/ExtractedAttributeDefinition.cs +++ b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/ExtractedAttributeDefinition.cs @@ -6,12 +6,12 @@ public class ExtractedAttributeDefinition : IEquatable /// The name of the attribute. /// - public string AttributeName { get; set; } + public string AttributeName { get; set; } = string.Empty; /// /// The namespace of the attribute. /// - public string AttributeNamespace { get; set; } + public string AttributeNamespace { get; set; } = string.Empty; /// /// A list of arguments passed to the attribute's constructor. @@ -27,9 +27,9 @@ public class ExtractedAttributeDefinition : IEquatable /// The object to compare with the current object. /// true if the specified object is equal to the current object; otherwise, false. - public bool Equals(ExtractedAttributeDefinition other) + public bool Equals(ExtractedAttributeDefinition? other) { - if (ReferenceEquals(null, other)) + if (other is null) return false; if (ReferenceEquals(this, other)) return true; @@ -42,9 +42,9 @@ public bool Equals(ExtractedAttributeDefinition other) /// /// The object to compare with the current object. /// true if the specified object is equal to the current object; otherwise, false. - public override bool Equals(object obj) + public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) + if (obj is null) return false; if (ReferenceEquals(this, obj)) return true; diff --git a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/ExtractedMemberTypeDefinition.cs b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/ExtractedMemberTypeDefinition.cs index c377a02442..eab8506663 100644 --- a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/ExtractedMemberTypeDefinition.cs +++ b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/ExtractedMemberTypeDefinition.cs @@ -8,12 +8,12 @@ public class ExtractedMemberTypeDefinition : IEquatable /// The name of the type /// - public string TypeName { get; set; } + public required string TypeName { get; set; } /// /// The namespace in which the type is defined /// - public string TypeNamespace { get; set; } + public required string TypeNamespace { get; set; } /// /// Gets or sets a value indicating whether the type is nullable. @@ -25,7 +25,7 @@ public class ExtractedMemberTypeDefinition : IEquatable /// The object to compare with the current object. /// true if the specified object is equal to the current object; otherwise, false. - public bool Equals(ExtractedMemberTypeDefinition other) + public bool Equals(ExtractedMemberTypeDefinition? other) { if (other == null) return false; @@ -41,7 +41,7 @@ public bool Equals(ExtractedMemberTypeDefinition other) /// The object to compare with the current object. /// true if the specified object is equal to the current object; otherwise, false. - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj is ExtractedMemberTypeDefinition other) return Equals(other); diff --git a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/ExtractedPropertyDefinition.cs b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/ExtractedPropertyDefinition.cs index d787b2b6cc..6ee07457c8 100644 --- a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/ExtractedPropertyDefinition.cs +++ b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/ExtractedPropertyDefinition.cs @@ -19,12 +19,12 @@ public class ExtractedPropertyDefinition : IMemberDefinition, IEquatable /// The name of the property /// - public string PropertyName { get; set; } + public required string PropertyName { get; init; } /// /// The definition of the type of this property /// - public ExtractedMemberTypeDefinition TypeDefinition { get; } = new(); + public required ExtractedMemberTypeDefinition TypeDefinition { get; init; } /// /// The member name for the field @@ -49,7 +49,7 @@ public class ExtractedPropertyDefinition : IMemberDefinition, IEquatable /// The modifiers for this property /// - public string[] Modifiers { get; internal set; } + public string[] Modifiers { get; internal set; } = []; /// /// Gets or sets a value indicating whether this property is partial. @@ -59,14 +59,14 @@ public class ExtractedPropertyDefinition : IMemberDefinition, IEquatable /// The modifiers for the setter of this property /// - public string[] SetterModifiers { get; internal set; } + public string[] SetterModifiers { get; internal set; } = []; /// /// Determines whether the specified object is equal to the current object. /// /// The object to compare with the current object. /// True if the specified object is equal to the current object; otherwise, false. - public override bool Equals(object obj) + public override bool Equals(object? obj) { return Equals(obj as ExtractedPropertyDefinition); } @@ -76,7 +76,7 @@ public override bool Equals(object obj) /// /// The ExtractedPropertyDefinition to compare with the current ExtractedPropertyDefinition. /// True if the specified ExtractedPropertyDefinition is equal to the current ExtractedPropertyDefinition; otherwise, false. - public bool Equals(ExtractedPropertyDefinition other) + public bool Equals(ExtractedPropertyDefinition? other) { if (other == null) return false; diff --git a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/ExtractedTypeDefinition.cs b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/ExtractedTypeDefinition.cs index 19a4f82a62..454cc8c442 100644 --- a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/ExtractedTypeDefinition.cs +++ b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/ExtractedTypeDefinition.cs @@ -8,53 +8,54 @@ public class ExtractedTypeDefinition : IEquatable /// /// The namespace in which the type resides /// - public string Namespace { get; set; } + public required string Namespace { get; init; } /// /// The scope of the class /// - public string Scope { get; set; } = "public"; + public required string Scope { get; init; } = "public"; /// /// The name of the type, excluding any namespace /// - public string TypeName { get; set; } + public required string TypeName { get; set; } /// /// The name of the kind of type being represented /// - public string TypeKind { get; set; } + public required string TypeKind { get; set; } /// /// The fully qualified name of the type, including namespace /// - public string FullyQualifiedName { get; set; } + public required string FullyQualifiedName { get; set; } /// /// The properties to be included in auto implementation /// - public IList Properties { get; private set; } = new List(); + public IList Properties { get; private set; } = []; /// /// The name of the base class for the type /// - public string BaseClassTypeName { get; internal set; } + public required string BaseClassTypeName { get; init; } /// /// The modifiers for this property /// - public string[] DefaultPropertyModifiers { get; internal set; } + public string[] DefaultPropertyModifiers { get; internal set; } = []; /// /// The modifiers for the setter of this property /// - public string[] DefaultPropertySetterModifiers { get; internal set; } + public required string[] DefaultPropertySetterModifiers { get; init; } + /// /// Determines whether the current object is equal to another object of the same type. /// /// The object to compare with the current object. /// true if the specified object is equal to the current object; otherwise, false. - public bool Equals(ExtractedTypeDefinition other) + public bool Equals(ExtractedTypeDefinition? other) { if (other == null) return false; @@ -80,7 +81,7 @@ public bool Equals(ExtractedTypeDefinition other) /// /// The object to compare with the current object. /// true if the specified object is equal to the current object; otherwise, false. - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj == null || GetType() != obj.GetType()) return false; diff --git a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/GenerationResults.cs b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/GenerationResults.cs index 83df665359..c58aaabb9b 100644 --- a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/GenerationResults.cs +++ b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/GenerationResults.cs @@ -18,13 +18,12 @@ public class GenerationResults /// /// The fully qualified name of the generated type /// - public string FullyQualifiedName { get; set; } + public required string FullyQualifiedName { get; set; } /// /// The source code that has been generated by the builder /// - public string GeneratedSource { get; set; } + public required string GeneratedSource { get; set; } } - -} +} \ No newline at end of file diff --git a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/IncrementalAutoImplementInterfacePartialsGenerator.cs b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/IncrementalAutoImplementInterfacePartialsGenerator.cs index 718d3c71b3..9e99c20c41 100644 --- a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/IncrementalAutoImplementInterfacePartialsGenerator.cs +++ b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/IncrementalAutoImplementInterfacePartialsGenerator.cs @@ -37,7 +37,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) { return TypeDefinitionExtractor.ExtractTypeDefinitionForInterfaces(new DefinitionExtractionContext(ctx.SemanticModel, true, false), typeDeclarationSyntax); } - return null; + return default!; }) .Where(static m => m is not null).WithTrackingName(TrackingNames.ExtractClasses); diff --git a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/IncrementalAutoImplementPropertiesPartialsGenerator.cs b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/IncrementalAutoImplementPropertiesPartialsGenerator.cs index 4ced917839..1aa1da458b 100644 --- a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/IncrementalAutoImplementPropertiesPartialsGenerator.cs +++ b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/IncrementalAutoImplementPropertiesPartialsGenerator.cs @@ -37,7 +37,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) { return TypeDefinitionExtractor.ExtractTypeDefinition(new DefinitionExtractionContext(ctx.SemanticModel, false, true), typeDeclarationSyntax); } - return null; + return default!; }) .Where(static m => m is not null).WithTrackingName(TrackingNames.ExtractClasses); diff --git a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/SerializationPartialBuilder.cs b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/SerializationPartialBuilder.cs index 23c0803e3f..5e72166173 100644 --- a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/SerializationPartialBuilder.cs +++ b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/AutoImplement/SerializationPartialBuilder.cs @@ -16,8 +16,6 @@ namespace Csla.Generator.AutoImplementProperties.CSharp.AutoImplement /// internal class SerializationPartialBuilder(bool nullable) { - - /// /// Build the text of a partial type that implements the properties of the target type /// diff --git a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/Csla.Generator.AutoImplementProperties.CSharp.csproj b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/Csla.Generator.AutoImplementProperties.CSharp.csproj index f86bb23287..7d5108fec5 100644 --- a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/Csla.Generator.AutoImplementProperties.CSharp.csproj +++ b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/Csla.Generator.AutoImplementProperties.CSharp.csproj @@ -25,6 +25,8 @@ True CSLA .NET Generators CSLA;Roslyn;Generator + enable + nullable @@ -44,6 +46,10 @@ + + all + runtime; build; native; contentfiles; analyzers +