Table of Contents

Enum ModelNullHandling

Namespace
ToSic.Eav.Models
Assembly
ToSic.Eav.Data.dll
[Flags]
[WorkInProgressApi("WIP v22")]
public enum ModelNullHandling

Fields

DataNullAsNull = 1

If original data is null, return null. This is the default behavior.

DataNullForceConvert = 16

If 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 = 2

If original data is null, throw an exception.

DataNullTryConvert = 4

If original data is null, try to return a model, unless the model says otherwise.

DataNullTryConvertOrThrow = 8

If original data is null, try to return a model, unless the model says otherwise - in which case throw.

Default = DataNullAsNull | ListNullAsEmpty | ModelNullAsNull | ModelNullSkip | TypeCheckAsNull

Defaults

  • 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 = 32

If the list is null, return an empty list anyhow. This is only meant for list conversions, and does not affect single item conversions.

ListNullThrows = 64

If the list is null, return an empty list anyhow. This is only meant for list conversions, and does not affect single item conversions.

ModelNullAsModel = 1024
ModelNullAsNull = 128

Return null if the model reports not being able to handle the data given to it. This is the default.

ModelNullSkip = 256
ModelNullThrows = 512
PreferModel = DataNullForceConvert | ListNullAsEmpty | ModelNullAsModel | TypeCheckIgnore
PreferNull = DataNullAsNull | ListNullAsEmpty | ModelNullAsNull | ModelNullSkip | TypeCheckAsNull
TypeCheckAsNull = 2048
TypeCheckFilter = 4096
TypeCheckIgnore = 8192
TypeCheckThrow = 16384
Undefined = 0

Represents an undefined state. Will be treated as Default, but can be used to detect if the caller explicitly set it or not.