diff --git a/AyCode.Core/Extensions/PropertyHelper.cs b/AyCode.Core/Extensions/PropertyHelper.cs index d1cf1dc..fe72497 100644 --- a/AyCode.Core/Extensions/PropertyHelper.cs +++ b/AyCode.Core/Extensions/PropertyHelper.cs @@ -9,12 +9,12 @@ public static class PropertyHelper { if (src == null || dest == null) return dest; - var srcProps = typeof(TSource).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(p => p.CanRead && !typeof(IEnumerable).IsAssignableFrom(p.PropertyType)); + var srcProps = typeof(TSource).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(p => p.CanRead);// && !typeof(IEnumerable).IsAssignableFrom(p.PropertyType)); foreach (var sp in srcProps) { var dp = typeof(TDestination).GetProperty(sp.Name, BindingFlags.Public | BindingFlags.Instance); - if (dp == null || !dp.CanWrite || typeof(IEnumerable).IsAssignableFrom(dp.PropertyType)) //dp.PropertyType.GetGenericTypeDefinition() == typeof(IEnumerable<>)) + if (dp == null || !dp.CanWrite) //|| typeof(IEnumerable).IsAssignableFrom(dp.PropertyType)) //dp.PropertyType.GetGenericTypeDefinition() == typeof(IEnumerable<>)) continue; dp.SetValue(dest, sp.GetValue(src));