예제 #1
0
        public void EditBiography(EditedBiography model)
        {
            var user = _systemUserRepository.GetFirstOrDefault(predicate: a => a.SystemUserId == model.SystemUserId, include: a => a.Include(b => b.EduUser));

            if (user == null)
            {
                throw new ApplicationException("System user id is invalid.");
            }

            var eduuser = user.EduUser.SingleOrDefault();

            eduuser.BriefIntroduction = model.BriefIntroduction;
            eduuser.Hobby             = model.Hobby;
            _eduUserRepository.Update(eduuser);
            _unitOfWork.SaveChanges();
        }
예제 #2
0
 public ActionResult Edit([FromBody]EditedBiography model)
 {
     _userProfileService.EditBiography(model);
     return Ok(MessageHelper.Success("The biography has been updated."));
 }