From 5d429e7286ed4b8abe2efdf5cba2281b8f5dc558 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 27 Oct 2023 15:32:22 -0400 Subject: [PATCH] - code linting Signed-off-by: Vincent Biret --- src/serialization/DeserializationHelpers.cs | 2 +- src/serialization/JsonDeserializationHelpers.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/serialization/DeserializationHelpers.cs b/src/serialization/DeserializationHelpers.cs index 5e790f54..74ee97c1 100644 --- a/src/serialization/DeserializationHelpers.cs +++ b/src/serialization/DeserializationHelpers.cs @@ -72,7 +72,7 @@ private static ParsableFactory GetFactoryFromType() where T : IParsable #endif { var type = typeof(T); - var factoryMethod = type.GetMethods().Where(static x => x.IsStatic && "CreateFromDiscriminatorValue".Equals(x.Name, StringComparison.OrdinalIgnoreCase)).FirstOrDefault() ?? + var factoryMethod = type.GetMethods().FirstOrDefault(static x => x.IsStatic && "CreateFromDiscriminatorValue".Equals(x.Name, StringComparison.OrdinalIgnoreCase)) ?? throw new InvalidOperationException($"No factory method found for type {type.Name}"); return (ParsableFactory)factoryMethod.CreateDelegate(typeof(ParsableFactory)); } diff --git a/src/serialization/JsonDeserializationHelpers.cs b/src/serialization/JsonDeserializationHelpers.cs index 4a4147fc..958b699c 100644 --- a/src/serialization/JsonDeserializationHelpers.cs +++ b/src/serialization/JsonDeserializationHelpers.cs @@ -13,7 +13,7 @@ namespace Microsoft.Kiota.Abstractions.Serialization; /// /// Set of helper methods for JSON serialization /// -public class JsonDeserializationHelpers +public static class JsonDeserializationHelpers { private const string _jsonContentType = "application/json"; ///