<PackageReference Include="Namotion.Reflection" Version="3.4.1" />

PropertyReader

static class PropertyReader
using System; using System.Reflection; using System.Runtime.CompilerServices; namespace Namotion.Reflection { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(0)] internal static class PropertyReader { private static Type GenericTypeDefinition = typeof(PropertyReader<object, object>).GetGenericTypeDefinition(); public static IPropertyReader Create(Type objectType, Type valueType, PropertyInfo propertyInfo) { return (IPropertyReader)Activator.CreateInstance(GenericTypeDefinition.MakeGenericType(objectType, valueType), propertyInfo); } } }