=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===
This commit is contained in:
@@ -43,6 +43,12 @@ public static class Mapper<T>
|
||||
/// <param name="destination">The target object that will receive the mapped property values.</param>
|
||||
/// <exception cref="ArgumentNullException">Thrown when <paramref name="source"/> or <paramref name="destination"/> is null.</exception>
|
||||
/// <exception cref="ArgumentException">Thrown when a source value is null but the corresponding destination property is a value type that is not <see cref="Nullable{T}"/>.</exception>
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
|
||||
/// "The summary states null values are only assigned to reference types or Nullable<T> types, but the condition `propType is { IsByRef: false } && propType.Name != \"Nullable\\`1\"` is true for reference types as well, so the code throws ArgumentException for reference types too." -->
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_exception
|
||||
/// "The exception is documented as thrown only when the destination property is a non-nullable value type, but the condition matches any non-Nullable property type (including reference types), so the exception is also thrown for reference-type properties." -->
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
|
||||
/// "The summary states that when source value type does not match the destination property type, the value is converted using Convert.ToDouble(object), but the unconditional `p.SetValue(destination, kv.Value, null)` after the else-if block overwrites the conversion, so the original (unconverted) value is always assigned." -->
|
||||
public static void Map(ExpandoObject source, T destination)
|
||||
{
|
||||
// Might as well take care of null references early.
|
||||
|
||||
Reference in New Issue
Block a user