Skip to content

Commit

Permalink
Merge pull request #4895 from vvdb-architecture/feature/csharppartial…
Browse files Browse the repository at this point in the history
…class

Implemented partial class model declarations.
  • Loading branch information
baywet authored Jun 26, 2024
2 parents 0254c19 + 6838810 commit b5ca324
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit b5ca324

Please sign in to comment.