Dev2.Runtime.Configuration.ExtensionMethods.ElementSafe C# (CSharp) Method

ElementSafe() public static method

public static ElementSafe ( this elem, string name ) : string
elem this
name string
return string
        public static string ElementSafe(this XElement elem, string name)
        {
            if(elem == null || string.IsNullOrEmpty(name))
            {
                return string.Empty;
            }

            var child = elem.Element(name);
            return child == null ? string.Empty : child.Value;
        }