BO4E/COM/ExterneReferenz.cs
/// <summary>
///     try to get a value from <see cref="BusinessObject.ExterneReferenzen" />
/// </summary>
/// <param name="extRefName">name of the externe referenz</param>
/// <param name="extRefWert">non-null if the externe referenz was found</param>
/// <param name="extReferences">list of external references</param>
/// <returns>true if externe referenz with name <paramref name="extRefName" /> was found</returns>
try to get a value from
try to get a value from
public static bool TryGetExterneReferenz(this ICollection<ExterneReferenz> extReferences, string extRefName,
            out string extRefWert)
        {
            if (extRefName == null) throw new ArgumentNullException(nameof(extRefName));
            if (extReferences == null)
            {
                extRefWert = null;
                return false;
            }
            var externeReferenz = extReferences.SingleOrDefault(er => er.ExRefName == extRefName);
            if (externeReferenz == null)
            {
                extRefWert = null;
                return false;
            }
            extRefWert = externeReferenz.ExRefWert;
            return true;
        }
public static bool TryGetExterneReferenz ( this ICollection < ExterneReferenz > extReferences , string extRefName , out string extRefWert ) { if ( extRefName == null ) throw new ArgumentNullException ( nameof ( extRefName ) ) ; if ( extReferences == null ) { extRefWert = null ; return false ; } var externeReferenz = extReferences . SingleOrDefault ( er => er . ExRefName == extRefName ) ; if ( externeReferenz == null ) { extRefWert = null ; return false ; } extRefWert = externeReferenz . ExRefWert ; return true ; }
try to get a value from
try to get a value from
true if externe referenz with name  was found
true if externe referenz with name was found
ICollection<ExterneReferenz>
this
extRefName
string
name of the externe referenz
name of the externe referenz
string
out
extRefWert
non-null if the externe referenz was found
non - null if the externe referenz was found
extReferences
list of external references
list of external references