Beispiel #1
0
        public static UserProfile LoadUserProfile(int userId)
        {
            string filePath    = CacheClient.GenerateUserProfileFilePath(userId);
            var    userProfile = CacheClient.ReadJsonObjectFile <UserProfile>(filePath);

            return(userProfile);
        }
Beispiel #2
0
        /// <summary>Stores a user's profile in the cache.</summary>
        public static bool SaveUserProfile(UserProfile userProfile)
        {
            Debug.Assert(userProfile != null);

            string filePath = CacheClient.GenerateUserProfileFilePath(userProfile.id);

            return(IOUtilities.WriteJsonObjectFile(filePath, userProfile));
        }
Beispiel #3
0
        public static bool SaveUserProfile(UserProfile userProfile)
        {
            Debug.Assert(userProfile != null);

            string filePath = CacheClient.GenerateUserProfileFilePath(userProfile.id);

            return(LocalDataStorage.WriteJSONFile(filePath, userProfile));
        }
Beispiel #4
0
        public static void SaveUserProfile(UserProfile userProfile)
        {
            Debug.Assert(userProfile.id > 0,
                         "[mod.io] Cannot cache a user profile without a user id");

            string filePath = CacheClient.GenerateUserProfileFilePath(userProfile.id);

            CacheClient.WriteJsonObjectFile(filePath, userProfile);
        }
Beispiel #5
0
        public static UserProfile LoadUserProfile(int userId)
        {
            string      filePath = CacheClient.GenerateUserProfileFilePath(userId);
            UserProfile userProfile;

            LocalDataStorage.ReadJSONFile(filePath, out userProfile);

            return(userProfile);
        }
Beispiel #6
0
 public static void DeleteUserProfile(int userId)
 {
     CacheClient.DeleteFile(CacheClient.GenerateUserProfileFilePath(userId));
 }
Beispiel #7
0
 /// <summary>Deletes a user's profile from the cache.</summary>
 public static bool DeleteUserProfile(int userId)
 {
     return(IOUtilities.DeleteFile(CacheClient.GenerateUserProfileFilePath(userId)));
 }
Beispiel #8
0
        public static bool DeleteUserProfile(int userId)
        {
            string path = CacheClient.GenerateUserProfileFilePath(userId);

            return(LocalDataStorage.DeleteFile(path));
        }