public List <BasicUserInfo> GetAllPublicProfile()
        {
            using (var db = new SystemDBContext())
            {
                // get all public profiles
                var profiles    = db.Profiles.Where(x => x.IsPrivate == false).ToList();
                var visibleUser = new List <BasicUserInfo>();

                // get all friends
                var friendService = new FriendService(UserToken);
                visibleUser.AddRange(friendService.GetAllFriends());

                foreach (var profile in profiles)
                {
                    // not contained in visible user yet ( not friends )
                    if (visibleUser.FirstOrDefault(x => x.HashId == profile.UserHashId) == null)
                    {
                        // search for user and add info if exist
                        var user = db.Users.FirstOrDefault(x => x.HashId == profile.UserHashId);
                        if (user != null)
                        {
                            visibleUser.Add(new BasicUserInfo()
                            {
                                AreFriend = false,
                                HashId    = user.HashId,
                                Username  = user.Username
                            });
                        }
                    }
                }
                return(visibleUser);
            }
        }
        public void DeleteUser(UserToken userToken)
        {
            using (var db = new SystemDBContext())
            {
                var user = db.Users.FirstOrDefault(x => x.HashId == userToken.UserId);
                if (user == null)
                {
                    throw HttpResponseExceptionHelper.Create("Identifiant d'usager invalide", HttpStatusCode.BadRequest);
                }

                db.Users.Remove(user);
                db.SaveChanges();
            }

            // delete all users friends
            var friendService = new FriendService(userToken);

            friendService.DeleteAllFriends();

            // delete profile
            var profileService = new ProfileService(userToken);

            profileService.DeleteMyProfile();

            // Delete daylies
            var dailyService = new DailyService(userToken);

            dailyService.DeleteAllDaily();
        }
        /// <summary>
        /// Get all the maps of your friends
        /// </summary>
        /// <returns></returns>
        public List <MapModel> GetMyFriendsZones()
        {
            var friendService = new FriendService(UserToken);
            var friends       = friendService.GetAllFriends();

            var maps = new List <MapModel>();

            foreach (var friend in friends)
            {
                maps.AddRange(GetUserMaps(friend.HashId));
            }

            return(maps);
        }