public MembershipUser GetUser(string username, bool userIsOnline, string providerName)
        {
            try
            {
                var users = _userRepository.Find(u => u.UserName == username);

                if (!users.Any())
                {
                    users = _userRepository.Find(u => u.Email == username);
                }
                var user = users.FirstOrDefault();
                if (user != null)
                {
                    ShopgunMembershipUser shopgunUser = new ShopgunMembershipUser(providerName, user.UserName,
                                                                                  user.Id.ToString(),
                                                                                  user.Email, "", "", true,
                                                                                  user.IsLockedOut,
                                                                                  user.CreationDate, user.LastLoginDate,
                                                                                  user.LastActivity,
                                                                                  user.LastPasswordChangedDate,
                                                                                  user.LastLockedOutDate,
                                                                                  user.Id, user.DisplayName,
                                                                                  user.Password,
                                                                                  user.FirstName, user.LastName, user.Mentor);

                    return shopgunUser;
                }
                return null;
                //Fallback for umbraco back office users
                //return GetUserFromFallbackMembershipProvider(username, userIsOnline, "UsersMembershipProvider");
            }
            catch(Exception e)
            {
                throw new Exception(e.Message,e);
            }
        }
        public MembershipUser GetUserById(int id, bool userIsOnline, string providerName)
        {
            try
            {
                var users = _userRepository.Find(u => u.Id == id);
                User user = users.FirstOrDefault();
                ShopgunMembershipUser shopgunUser = new ShopgunMembershipUser(providerName, user.UserName, new Guid(),
                                                                              user.Email, "", "", true, user.IsLockedOut,
                                                                              user.CreationDate, user.LastLoginDate,
                                                                              user.LastActivity,
                                                                              user.LastPasswordChangedDate,
                                                                              user.LastLockedOutDate,
                                                                              user.Id, user.DisplayName, user.Password,
                                                                              user.FirstName, user.LastName, user.Mentor);

                return shopgunUser;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }
        public MembershipUser GetUserByMail(string email, string providerName)
        {
            try
            {
                var users = _userRepository.Find(u => u.Email == email);
                User user = users.FirstOrDefault();

                if (user != null)
                {
                    ShopgunMembershipUser shopgunUser = new ShopgunMembershipUser(providerName, user.UserName,
                                                                                  new Guid(),
                                                                                  user.Email, "", "", true,
                                                                                  user.IsLockedOut,
                                                                                  user.CreationDate, user.LastLoginDate,
                                                                                  user.LastActivity,
                                                                                  user.LastPasswordChangedDate,
                                                                                  user.LastLockedOutDate,
                                                                                  user.Id, user.DisplayName,
                                                                                  user.Password,
                                                                                  user.FirstName, user.LastName, user.Mentor);

                    return shopgunUser;
                }
                //TODO: Check if email exist in the Fallback Membership Provider.
                return null;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }