Browse Source

Refactor condition in IsCollectionGenericTypeInternal for clarity

pull/24917/head
maliming 6 months ago
parent
commit
ee47706de6
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 4
      framework/src/Volo.Abp.ObjectMapping/Volo/Abp/ObjectMapping/ObjectMappingHelper.cs

4
framework/src/Volo.Abp.ObjectMapping/Volo/Abp/ObjectMapping/ObjectMappingHelper.cs

@ -55,8 +55,8 @@ public static class ObjectMappingHelper
return true;
}
if (type.IsGenericType &&
supportedCollectionTypes.Contains(type.GetGenericTypeDefinition()) ||
if ((type.IsGenericType &&
supportedCollectionTypes.Contains(type.GetGenericTypeDefinition())) ||
type.GetInterfaces().Any(i => i.IsGenericType && supportedCollectionTypes.Contains(i.GetGenericTypeDefinition())))
{
if (!type.IsGenericType)

Loading…
Cancel
Save