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

            return(userProfile);
        }
示例#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));
        }
示例#3
0
        public static bool SaveUserProfile(UserProfile userProfile)
        {
            Debug.Assert(userProfile != null);

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

            return(LocalDataStorage.WriteJSONFile(filePath, userProfile));
        }
示例#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);
        }
示例#5
0
        public static UserProfile LoadUserProfile(int userId)
        {
            string      filePath = CacheClient.GenerateUserProfileFilePath(userId);
            UserProfile userProfile;

            LocalDataStorage.ReadJSONFile(filePath, out userProfile);

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

            return(LocalDataStorage.DeleteFile(path));
        }