Beispiel #1
0
 public DataResult RemoveFriend(User user, User friend)
 {
     user.Friends.Remove(friend);
     return new DataResult();
 }
Beispiel #2
0
 public List<User> GetFollowedBy(User user)
 {
     return DataContext.Users.Where(p => p.Friends.Any(f => f.Id == user.Id)).ToList();
 }
Beispiel #3
0
 public DataResult ChangePassword(User user, string password)
 {
     user.Password = HashHelpers.GetSHA256Hash(password,user.Salt.ToString());
     return new DataResult(Main.ChangePAsswordMessage);
 }
Beispiel #4
0
 public DataResult AddUser(User user)
 {
     DataContext.Users.Add(user);
     return new DataResult(Main.AddedUser);
 }
Beispiel #5
0
 public DataResult AddFriend(User user, User friend)
 {
     user.Friends.Add(friend);
     return new DataResult();
 }
Beispiel #6
0
        public DataResult UpdateProfile(User oldUser, User newUser)
        {
            oldUser.Email = newUser.Email;
            oldUser.FirstName = newUser.FirstName;
            oldUser.LastName = newUser.LastName;
            oldUser.CurrentLocation = newUser.CurrentLocation;
            oldUser.Weight = newUser.Weight;
            oldUser.Height = newUser.Height;
            oldUser.FavouriteSport = newUser.FavouriteSport;
            oldUser.IsPublicProfile = newUser.IsPublicProfile;
            oldUser.BirthDate = newUser.BirthDate;
            oldUser.WorkoutPrivacy = newUser.WorkoutPrivacy;

            return new DataResult(Main.UpdateProfileMessage);
        }