BlogEngine.Core.Providers.XmlMembershipProvider.GetUserNameByEmail C# (CSharp) Method

GetUserNameByEmail() public method

Retrieves a username based on a matching email.
public GetUserNameByEmail ( string email ) : string
email string /// The email. ///
return string
        public override string GetUserNameByEmail(string email)
        {
            if (email == null)
            {
                throw new ArgumentNullException("email");
            }

            var doc = new XmlDocument();
            doc.Load(XmlFullyQualifiedPath);

            return doc.GetElementsByTagName("User").Cast<XmlNode>().Where(
                node => node.ChildNodes[2].InnerText.Equals(email.Trim(), StringComparison.OrdinalIgnoreCase)).Select(
                    node => node.ChildNodes[0].InnerText).FirstOrDefault();
        }