Enum ModelNullHandling
[Flags]
[WorkInProgressApi("WIP v22")]
public enum ModelNullHandling
Fields
DataNullAsNull = 1If original data is null, return null. This is the default behavior.
DataNullForceConvert = 16If original data is null, force return a model, even if the model may not be able to handle it. This is a very aggressive option and should only be used if you are sure that the model can handle null sources, or if you want to force it to do so for testing purposes.
DataNullThrows = 2If original data is null, throw an exception.
DataNullTryConvert = 4If original data is null, try to return a model, unless the model says otherwise.
DataNullTryConvertOrThrow = 8If original data is null, try to return a model, unless the model says otherwise - in which case throw.
Default = DataNullAsNull | ListNullAsEmpty | ModelNullAsNull | ModelNullSkip | TypeCheckAsNullDefaults
- null-lists will return an empty list
- null-data will return null
- null-models will return null
- in list scenarios, null-models will be filtered out
ListNullAsEmpty = 32If the list is null, return an empty list anyhow. This is only meant for list conversions, and does not affect single item conversions.
ListNullThrows = 64If the list is null, return an empty list anyhow. This is only meant for list conversions, and does not affect single item conversions.
ModelNullAsModel = 1024ModelNullAsNull = 128Return null if the model reports not being able to handle the data given to it. This is the default.
ModelNullSkip = 256ModelNullThrows = 512PreferModel = DataNullForceConvert | ListNullAsEmpty | ModelNullAsModel | TypeCheckIgnorePreferNull = DataNullAsNull | ListNullAsEmpty | ModelNullAsNull | ModelNullSkip | TypeCheckAsNullTypeCheckAsNull = 2048TypeCheckFilter = 4096TypeCheckIgnore = 8192TypeCheckThrow = 16384Undefined = 0Represents an undefined state. Will be treated as Default, but can be used to detect if the caller explicitly set it or not.