public Account FindByPathName(AccountPathName name)
        {
            var fullName = AccountPathName.FromParentNameAndString(GetRootAccount().PathName, name.Path);
            var res = GetActiveSession().Linq<Account>()
                .Where(a => a.PathName == fullName)
                .Take(1).ToArray();

            return res.Length == 0 ? null : res[0];
        }
        public Account FindByPathName(AccountPathName name)
        {
            if (name.Equals(_subroot1.PathName))
                return _subroot1;

            if (name.Equals(_subroot2.PathName))
                return _subroot2;

            return _root;
        }
 public static AccountPathName FromParentNameAndString(
     AccountPathName parentPathName, string accountName)
 {
     return FromString(parentPathName + SEPARATOR + accountName);
 }