Skip to content

Consolidate nullable logic out of IObjectMappers #1987

@jbogard

Description

@jbogard

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions