예제 #1
0
        public MentorProfileViewModel ToMentorProfileViewModel(Mentor mentor)
        {
            var mentorProfileViewModel = new MentorProfileViewModel
            {
                Id             = mentor.Id,
                FullName       = mentor.User.FullName,
                Specialization = mentor.Specialization.Name,
                Email          = mentor.User.Contacts.Email,
                Phone          = mentor.User.Contacts.Phone,
                Skype          = mentor.User.Contacts.Skype,
                LinkedIn       = mentor.User.Contacts.LinkedIn,
                AvatarUrl      = mentor.User.Avatar.Base64Url
            };

            return(mentorProfileViewModel);
        }
예제 #2
0
        public ActionResult UserProfile()
        {
            var user   = User.Identity.GetUserIdentity();
            var mentor = _mentor.GetMentor(user.UserId);

            if (mentor.Address == null)
            {
                return(RedirectToAction("AddBio"));
            }

            var model = new MentorProfileViewModel
            {
                Mentor  = mentor,
                Mentees = _mentee.GetMentees(user.UserId)
            };

            return(View(model));
        }