Serilog.Sinks.MSSqlServer.SetProperty
Helper for applying only those properties actually specified in external configuration.
Simulates passing a property-setter to an "out" argument.
This will only set a value (execute the PropertySetter delegate) if the value is non-null.
It also converts the provided value to the requested enum type. This allows configuration to only
apply property changes when external configuration has actually provided a value.
public static void IfEnumProvided<T>(ConfigurationElement element, string propertyName, PropertySetter<T> setter) where T : Enum
Test the underlying enum property collection's value-origin flag for a non-default string value. Empty strings allowed.
This will only set a value (execute the PropertySetter delegate) if the value is non-null.
It also converts the provided value to the requested type. This allows configuration to only
apply property changes when external configuration has actually provided a value.
This will only set a value (execute the PropertySetter delegate) if the value is non-null and
isn't empty or whitespace. This override is used when {T} is a string value that can't be empty.
It also converts the provided value to the requested type. This allows configuration to only
apply property changes when external configuration has actually provided a value.
public static void IfProvided<T>(ConfigurationElement element, string propertyName, PropertySetter<T> setter)
Test the underlying property collection's value-origin flag for a non-default string value. Empty strings allowed.
public static void IfProvidedNotEmpty<T>(ConfigurationElement element, string propertyName, PropertySetter<T> setter)
Test the underlying property collection's value-origin flag for a non-default, non-null, non-empty string value.