From 6ddc6d0c088ee3f65ef1fe36750b7f2cfd6fbddb Mon Sep 17 00:00:00 2001 From: vvdb-architecture Date: Wed, 26 Jun 2024 16:51:31 +0200 Subject: [PATCH 1/2] Implemented partial class model declarations. See: - https://github.com/microsoft/kiota/issues/4894 - https://github.com/microsoft/kiota/issues/4894 --- src/Kiota.Builder/Writers/CSharp/CodeClassDeclarationWriter.cs | 2 +- .../Writers/CSharp/CodeClassDeclarationWriterTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Kiota.Builder/Writers/CSharp/CodeClassDeclarationWriter.cs b/src/Kiota.Builder/Writers/CSharp/CodeClassDeclarationWriter.cs index c6aa150712..040381a0fb 100644 --- a/src/Kiota.Builder/Writers/CSharp/CodeClassDeclarationWriter.cs +++ b/src/Kiota.Builder/Writers/CSharp/CodeClassDeclarationWriter.cs @@ -38,7 +38,7 @@ public override void WriteCodeElement(ClassDeclaration codeElement, LanguageWrit bool hasDescription = conventions.WriteLongDescription(parentClass, writer); conventions.WriteDeprecationAttribute(parentClass, writer); if (!hasDescription) writer.WriteLine("#pragma warning disable CS1591"); - writer.WriteLine($"public class {codeElement.Name.ToFirstCharacterUpperCase()} {derivation}"); + writer.WriteLine($"public partial class {codeElement.Name.ToFirstCharacterUpperCase()} {derivation}"); if (!hasDescription) writer.WriteLine("#pragma warning restore CS1591"); writer.StartBlock(); } diff --git a/tests/Kiota.Builder.Tests/Writers/CSharp/CodeClassDeclarationWriterTests.cs b/tests/Kiota.Builder.Tests/Writers/CSharp/CodeClassDeclarationWriterTests.cs index 80bbe163f9..d9100b9886 100644 --- a/tests/Kiota.Builder.Tests/Writers/CSharp/CodeClassDeclarationWriterTests.cs +++ b/tests/Kiota.Builder.Tests/Writers/CSharp/CodeClassDeclarationWriterTests.cs @@ -51,7 +51,7 @@ public void WritesSimpleDeclaration() { codeElementWriter.WriteCodeElement(parentClass.StartBlock, writer); var result = tw.ToString(); - Assert.Contains("public class", result); + Assert.Contains("public partial class", result); } [Fact] From 683881093eda9545d84820f66a1dda7c852724cf Mon Sep 17 00:00:00 2001 From: vvdb-architecture Date: Wed, 26 Jun 2024 18:16:03 +0200 Subject: [PATCH 2/2] Updated changelog as requested. --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5876f44c57..a579967daa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- Implemented partial class model declarations. [4894](https://github.com/microsoft/kiota/issues/4894) + ### Added ### Changed