public virtual DataResultUserProfile Get(IUserRequestModel userRequest) { if (!_objCacheManager.Contains(this.CacheManager_GetKey(userRequest))) { ProfileBase p = ProfileBase.Create(userRequest.UserFormsIdentity.Name, userRequest.UserFormsIdentity.IsAuthenticated); UserProfileModel userProfile = new UserProfileModel(p); DataResultUserProfile result = new DataResultUserProfile() { IsValid = true, Data = userProfile, MessageType = DataResultMessageType.Success }; _objCacheManager.Add(this.CacheManager_GetKey(userRequest), result, _objCachePolicy); } return (DataResultUserProfile)_objCacheManager.Get(this.CacheManager_GetKey(userRequest)); }
public virtual DataResultUserProfile Update(UserProfileModel userProfile, IUserRequestModel userRequest) { if (_objCacheManager.Contains(this.CacheManager_GetKey(userRequest))) { _objCacheManager.Remove(this.CacheManager_GetKey(userRequest)); } ProfileBase p = ProfileBase.Create(userRequest.UserFormsIdentity.Name); userProfile.SetProfileBasePropertyValues(ref p); p.Save(); DataResultUserProfile result = new DataResultUserProfile() { IsValid = true, Data = userProfile, MessageType = DataResultMessageType.Success }; return result; }