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

PropertyWriter

static class PropertyWriter
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 PropertyWriter { private static Type GenericTypeDefinition = typeof(PropertyWriter<object, object>).GetGenericTypeDefinition(); public static IPropertyWriter Create(Type objectType, Type valueType, PropertyInfo propertyInfo) { return (IPropertyWriter)Activator.CreateInstance(GenericTypeDefinition.MakeGenericType(objectType, valueType), propertyInfo); } } }