Skip to content

Commit

Permalink
- code linting
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed Sep 21, 2023
1 parent cdb013c commit cfeab27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Kiota.Builder/Writers/CSharp/CodeMethodWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private void WriteFactoryMethodBodyForUnionModel(CodeMethod codeElement, CodeCla
var includeElse = false;
foreach (var property in parentClass.GetPropertiesOfKind(CodePropertyKind.Custom)
.OrderBy(static x => x, CodePropertyTypeForwardComparer)
.ThenBy(static x => x.Name))
.ThenBy(static x => x.Name, StringComparer.Ordinal))
{
if (property.Type is CodeType propertyType)
if (propertyType.TypeDefinition is CodeClass && !propertyType.IsCollection)
Expand Down Expand Up @@ -159,7 +159,7 @@ private void WriteFactoryMethodBodyForIntersectionModel(CodeMethod codeElement,
foreach (var property in parentClass.GetPropertiesOfKind(CodePropertyKind.Custom)
.Where(static x => x.Type is not CodeType propertyType || propertyType.IsCollection || propertyType.TypeDefinition is not CodeClass)
.OrderBy(static x => x, CodePropertyTypeBackwardComparer)
.ThenBy(static x => x.Name))
.ThenBy(static x => x.Name, StringComparer.Ordinal))
{
if (property.Type is CodeType propertyType)
{
Expand Down Expand Up @@ -331,7 +331,7 @@ private void WriteDeserializerBodyForInheritedModel(bool shouldHide, CodeMethod
foreach (var otherProp in parentClass
.GetPropertiesOfKind(CodePropertyKind.Custom)
.Where(static x => !x.ExistsInBaseType)
.OrderBy(static x => x.Name))
.OrderBy(static x => x.Name, StringComparer.Ordinal))
{
writer.WriteLine($"{{\"{otherProp.WireName}\", n => {{ {otherProp.Name.ToFirstCharacterUpperCase()} = n.{GetDeserializationMethodName(otherProp.Type, codeElement)}; }} }},");
}
Expand Down

0 comments on commit cfeab27

Please sign in to comment.