BO4E/UserPropertiesExtensions.cs
/// <summary>
///     same as <see cref="TryGetUserProperty{TUserProperty,TParent}" /> if <paramref name="userPropertyKey" /> was not
///     found or the user properties are null
/// </summary>
/// <typeparam name="TUserProperty">
///     type expected to be found in the User Property with key
///     <paramref name="userPropertyKey" />
/// </typeparam>
/// <param name="userPropertyKey">key of the <paramref name="parent" />.UserProperties dictionary</param>
/// <typeparam name="TParent">class implementing <see cref="IUserProperties" /></typeparam>
/// <param name="parent">object implementing <see cref="IUserProperties" /></param>
/// <param name="defaultValue">
///     default value returned if <paramref name="parent" />.UserProperties are null or the key was
///     not found
/// </param>
/// <returns>the value stored in the userproperty or the default <paramref name="defaultValue" /></returns>
/// <exception cref="ArgumentNullException">iff <paramref name="userPropertyKey" /> is null or whitespace</exception>
same as  if  was not
found or the user properties are null
same as if was not found or the user properties are null
public static TUserProperty GetUserProperty<TUserProperty, TParent>(this TParent parent, string userPropertyKey,
            TUserProperty defaultValue) where TParent : IUserProperties
        {
            if (parent != null && parent.TryGetUserProperty(userPropertyKey, out TUserProperty actualValue))
                return actualValue;
            return defaultValue;
        }
public static TUserProperty GetUserProperty < TUserProperty , TParent > ( this TParent parent , string userPropertyKey , TUserProperty defaultValue ) where TParent : IUserProperties { if ( parent != null && parent . TryGetUserProperty ( userPropertyKey , out TUserProperty actualValue ) ) return actualValue ; return defaultValue ; }
same as  if  was not
found or the user properties are null
same as if was not found or the user properties are null
the value stored in the userproperty or the default
the value stored in the userproperty or the default
iff  is null or whitespace
iff is null or whitespace
TParent
this
userPropertyKey
string
key of the .UserProperties dictionary
key of the . UserProperties dictionary
defaultValue
TUserProperty
default value returned if .UserProperties are null or the key was
not found
default value returned if . UserProperties are null or the key was not found
parent
None
typeparam
type expected to be found in the User Property with key
type expected to be found in the User Property with key
typeparam
None