public JsonResult EditMainInfo(ProfileMainInfoJson profileMainInfoJson) { profileMainInfoJson.TrimAndUppercaseFirst(); TraineeProfile editingProfileWithMainInfo = _profileMapper.FromProfileMainInfoJsonModel(profileMainInfoJson); TraineeProfile editedProfile = _profileProvider.UpdateMainInfo(editingProfileWithMainInfo); ProfileMainInfoJson updatedProfileMainInfoJson = _profileMapper.ToJsonProfileMainInfoModel(editedProfile); return(Json(updatedProfileMainInfoJson, JsonRequestBehavior.AllowGet)); }
public TraineeProfile FromProfileMainInfoJsonModel(ProfileMainInfoJson profileJson) { var profile = _mapper.Map <ProfileMainInfoJson, TraineeProfile>(profileJson); profile.Trainee = new Trainee { User = new User { Contacts = new Contacts { Email = profileJson.Email, Phone = profileJson.Phone, LinkedIn = profileJson.LinkedIn, Skype = profileJson.Skype } } }; return(profile); }