Пример #1
0
        public void CheckIfFollowing(int profileId, ProfileModel profile)
        {
            var result = (from f in db.Followers
                          where f.FollowerId == profileId
                          where f.FollowingId == profile.ProfileId
                          select f).FirstOrDefault();

            if(result != null)
            {
                profile.Followed = true;
            }
            else
            {
                profile.Followed = false;
            }
        }
Пример #2
0
        public ProfileModel ConvertToModel(Profile profile)
        {
            ProfileModel profileM = new ProfileModel()
            {
                ProfileId = profile.ProfileId,
                UserId = profile.UserId,
                Age = profile.Age,
                FirstName = profile.FirstName,
                LastName = profile.LastName,
                Degree = profile.Degree,
                City = profile.City,
                Country = profile.Country,
                School = profile.School,
                UserImage = profile.UserImage,
                About = profile.About,
            };

            return profileM;
        }