public AboutViewModel(User user, UserProfile userProfile, Image profilePicture) { ProfilePictureName = profilePicture.FileName; ProfilePicturePath = (profilePicture.Path != "no-image.png") ? user.UserID + "/" + profilePicture.Path : profilePicture.Path; HomeTown = (userProfile.HomeTown != null) ? PlaceViewModel.GetPlaceObjectt(userProfile.HomeTown) : new PlaceViewModel(); if (userProfile.PastLocal != null) { string[] userProfilePastLocals = userProfile.PastLocal.Split(','); foreach (string pl in userProfilePastLocals) { if (pl != "") { PastLocals.Add(PlaceViewModel.GetPlaceObjectt(pl)); } } } else { PastLocals.Add(new PlaceViewModel()); } LastTraveled = (userProfile.LastTraveled != null) ? PlaceViewModel.GetPlaceObjectt(userProfile.LastTraveled) : new PlaceViewModel(); if (userProfile.FavoritePlace != null) { string[] userProfileFavoritePlaces = userProfile.FavoritePlace.Split(','); foreach (string fp in userProfileFavoritePlaces) { if (fp != "") { FavoritePlaces.Add(PlaceViewModel.GetPlaceObjectt(fp)); } } } FirstName = user.FirstName; LastName = user.LastName; DOB = userProfile.DOB; DateTime now = DateTime.Today; Age = (now.Year - DOB.Year); if (now < DOB.AddYears(Age)) { Age--; } About = userProfile.About; Birthday = String.Format("{0:MMMM d}", DOB); MemberSince = String.Format("{0:M/d/yyyy}", user.DateJoined); }