We have nullable logic all over the place. Both in terms of checking types and doing mapping junk. I want to move the nullable stuff that's junking up our IObjectMappers out.
Here's the basic logic for two values:
| Source |
Dest |
Src Value |
Dest Value |
| T |
U? |
T |
Map(T, U) |
| T |
U? |
default(T) |
Map(T, U) |
| T? |
U |
T |
Map(T, U) |
| T? |
U |
null |
default(U) |
| T? |
U? |
T |
Map(T, U) |
| T? |
U? |
null |
default(U?) |
| V |
U |
V |
Map(V, U) |
| V |
U |
null |
default(U) |
| V |
U? |
V |
Map(V, U) |
| V |
U? |
null |
default(U?) |
where T: struct, V: class
I think we could wrap this logic in one place for top-level maps and member-level maps.