Table of Contents

Enum NullHandling

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

Fields

Default = 0

Represents an undefined state. Will usually behave the same as ReturnNull.

In rare cases the behavior might be different, since the system can detect if it was explicitly set or not.

ReturnModel = 4

If data is null, force conversion, even if the model may not be able to handle it.

This 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.

Exceptions during conversion raised by the model itself will still be thrown.

ReturnNull = 2

If data is null, just return null. No conversion will be attempted, and no exception will be thrown. This is the default behavior.

Throw = 8

If data is null, throw an exception.

TryOrNull = 16

If data is null, try to convert. If the model does not accept null, it will return null. If the model setup operation throws an exception, it will be raised, as it shows bad model design or a very unusual situation.

TryOrThrow = 32

If data is null, try to convert. If the model does not accept null, it will throw an exception.