Esempio n. 1
0
        /// <summary>
        /// thêm mới hoặc update thông tin profile của user
        /// </summary>
        /// <param name="profileInfo"></param>
        /// <returns></returns>
        public bool CreateOrUpdateUserProfile(ProfileUpdateInfoVM profileInfo)
        {
            var userProfile = GetUserProfile(profileInfo.ProfileId);

            if (userProfile == null)
            {
                userProfile = new UserProfile();
                _userProfileRepository.Add(userProfile);
            }
            userProfile = ServiceAutoMapModelMapper.MapExits <ProfileUpdateInfoVM, UserProfile>(profileInfo, userProfile);
            //ProfileUpdateInfoVM.ToModel(profileInfo, ref userProfile);

            userProfile.UserId = _userId;
            _userProfileRepository.Save();
            ResetDataCache();
            return(true);
        }
Esempio n. 2
0
 /// <summary>
 /// xóa 1 profile của user
 /// </summary>
 /// <param name="userProfileInfo"></param>
 /// <returns></returns>
 public bool DeleteUserProfile(ProfileUpdateInfoVM userProfileInfo)
 {
     return(DeleteUserProfile(userProfileInfo.ProfileId));
 }