Skip to content

Commit

Permalink
use maxby
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored and oskardudycz committed May 19, 2024
1 parent 3e3104c commit 5706cbb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Core.Serialization/Newtonsoft/JsonObjectContractProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,5 @@ private static ObjectConstructor<object> GetObjectConstructor(MethodBase method)
private static ConstructorInfo? GetTheMostSpecificConstructor(Type objectType) =>
objectType
.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
.OrderByDescending(e => e.GetParameters().Length)
.FirstOrDefault();
.MaxBy(e => e.GetParameters().Length);
}

0 comments on commit 5706cbb

Please sign in to comment.