14 public string Name {
get; }
39 var nullCtx =
new NullabilityInfoContext();
40 var nullInfo = nullCtx.Create(prop);
45 Type = prop.PropertyType;
46 IsNullable = nullInfo.WriteState is NullabilityState.Nullable;
56 if (_serializer is
null)
58 _serializer = Serialization.Serializer.Generate(_ctx,
Type);
59 if (
IsNullable && (!_serializer.GetType().IsGenericType ||
60 (_serializer.GetType().IsGenericType &&
61 _serializer.GetType().GetGenericTypeDefinition() !=
62 typeof(NullableStructSerializer<>))))
64 var serType = typeof(NullableSerializer<>).MakeGenericType(
new[] {
Type });
65 var ser = Activator.CreateInstance(serType,
new[] { _serializer });
A class representing the mapping context to be used during serialization and deserialization.