Open sandboxFocus

Method SuppressNonNullableFieldMustContainValue

SuppressNonNullableFieldMustContainValue(IAspectBuilder, IFieldOrProperty, IEnumerable<IConstructor>)

Suppresses the warning CS8618 ("Non-nullable variable must contain a non-null value when exiting constructor.") on selected constructors for a member that is being introduced, if necessary. This is useful for design-time diagnostics.

Declaration
public static void SuppressNonNullableFieldMustContainValue(IAspectBuilder builder, IFieldOrProperty introducedMember, IEnumerable<IConstructor> constructors)
Parameters
Type Name Description
IAspectBuilder builder
IFieldOrProperty introducedMember
IEnumerable<IConstructor> constructors