Exemplo n.º 1
0
        public bool DeleteDevice(string deviceToken)
        {
            var userProfileRepository = new UserProfileRepository();
            var userProfile           = userProfileRepository.GetProfileByDeviceToken(deviceToken);

            userProfile.Devices.Remove(userProfile.Devices.First(d => d.DeviceToken == deviceToken));

            return(userProfileRepository.SaveUserProfile(userProfile));
        }
Exemplo n.º 2
0
        public bool UpdateDevice(string oldDeviceToken, string newDeviceToken)
        {
            var userProfileRepository = new UserProfileRepository();
            var userProfile           = userProfileRepository.GetProfileByDeviceToken(oldDeviceToken);

            userProfile.Devices.First(d => d.DeviceToken == oldDeviceToken).DeviceToken = newDeviceToken;

            return(userProfileRepository.SaveUserProfile(userProfile));
        }