Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Standard/ObjectExtensions.cs =================================================================== diff -u -r6404 -r7077 --- DamEngine/trunk/src/Deltares.DamEngine.Data/Standard/ObjectExtensions.cs (.../ObjectExtensions.cs) (revision 6404) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Standard/ObjectExtensions.cs (.../ObjectExtensions.cs) (revision 7077) @@ -1,4 +1,4 @@ -// Copyright (C) Stichting Deltares 2025. All rights reserved. +// Copyright (C) Stichting Deltares 2026. All rights reserved. // // This file is part of the Dam Engine. // @@ -45,7 +45,7 @@ /// True when almost equal public static bool AlmostEquals(this double double1, double double2) { - return AlmostEquals(double1, double2, threshold); + return double1.AlmostEquals(double2, threshold); } /// @@ -67,7 +67,7 @@ return false; } - return (Math.Abs(double1 - double2) <= precision); + return Math.Abs(double1 - double2) <= precision; } /// @@ -253,7 +253,7 @@ return lookup[stringVal]; } - return (T) ToEnumType(value, typeof(T)); + return (T) value.ToEnumType(typeof(T)); } /// @@ -298,8 +298,7 @@ if (!origin.Equals(default(T1)) && destinationProperty.CanWrite) { PropertyInfo propertyInfo = destinationProperty; - origin.GetType().GetProperties().Where( - x => x.CanRead && (x.Name == propertyInfo.Name && x.PropertyType == propertyInfo.PropertyType)) + origin.GetType().GetProperties().Where(x => x.CanRead && x.Name == propertyInfo.Name && x.PropertyType == propertyInfo.PropertyType) .ToList() .ForEach(x => propertyInfo.SetValue(destination, x.GetValue(origin, null), null)); } @@ -343,7 +342,7 @@ } else { - pInfo.SetValue(dest, ToType(value, pInfo.PropertyType), null); + pInfo.SetValue(dest, value.ToType(pInfo.PropertyType), null); } } }