diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9479c74..aeea5e8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,6 @@ name: GreenPipes env: - GREENPIPES_VERSION: 4.0.1 + GREENPIPES_VERSION: 4.0.2 DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: true on: diff --git a/src/GreenPipes/Internals/Reflection/ReadOnlyPropertyCache.cs b/src/GreenPipes/Internals/Reflection/ReadOnlyPropertyCache.cs index aaf3a23..5d0118d 100644 --- a/src/GreenPipes/Internals/Reflection/ReadOnlyPropertyCache.cs +++ b/src/GreenPipes/Internals/Reflection/ReadOnlyPropertyCache.cs @@ -51,6 +51,8 @@ static IDictionary> CreatePropertyCache() { return new Dictionary>(typeof(T).GetAllProperties() .Where(x => x.CanRead) + .GroupBy(x => x.Name, StringComparer.OrdinalIgnoreCase) + .Select(x => x.Last()) .Select(x => new ReadOnlyProperty(x)) .ToDictionary(x => x.Property.Name)); } diff --git a/src/GreenPipes/Internals/Reflection/ReadWritePropertyCache.cs b/src/GreenPipes/Internals/Reflection/ReadWritePropertyCache.cs index f2658e0..5e5838f 100644 --- a/src/GreenPipes/Internals/Reflection/ReadWritePropertyCache.cs +++ b/src/GreenPipes/Internals/Reflection/ReadWritePropertyCache.cs @@ -57,6 +57,8 @@ static IDictionary> CreatePropertyCache(bool includ return new Dictionary>(typeof(T).GetAllProperties() .Where(x => x.CanRead && (includeNonPublic || x.CanWrite)) .Where(x => x.SetMethod != null) + .GroupBy(x => x.Name, StringComparer.OrdinalIgnoreCase) + .Select(x => x.Last()) .Select(x => new ReadWriteProperty(x)) .ToDictionary(x => x.Property.Name)); }