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

AttributeSafe() public static method

public static AttributeSafe ( this elem, string name ) : string
elem this
name string
return string
        public static string AttributeSafe(this XElement elem, string name)
        {
            if(elem == null || string.IsNullOrEmpty(name))
            {
                return string.Empty;
            }
            var attr = elem.Attribute(name);
            return attr == null ? string.Empty : attr.Value;
        }