<PackageReference Include="Namotion.Reflection" Version="2.0.7" />

ObjectExtensions

public static class ObjectExtensions
Object extensions.
public static bool DisableNullabilityValidation { get; set; }

Gets or sets a value indicating whether to disable nullability validation completely (global).

public static void EnsureValidNullability(this object obj, bool checkChildren = true)

Checks whether the object has valid non nullable properties.

public static bool HasProperty(this object obj, string propertyName)

Determines whether the specified property name exists.

public static bool HasValidNullability(this object obj, bool checkChildren = true)

Checks whether the object has valid non nullable properties.

public static T TryGetPropertyValue<T>(this object obj, string propertyName, T defaultValue = null)

Determines whether the specified property name exists.

public static IEnumerable<string> ValidateNullability(this object obj, bool checkChildren = true)

Checks which non nullable properties are null (invalid).