Exemple #1
0
        public static UserDto MergeUserWithAzureData(User userFromRepo, Microsoft.Graph.User userFromAzureAd,
                                                     IMapper mapper)
        {
            var dtoFromDb = mapper.Map <UserDto>(userFromRepo);

            return(mapper.Map(userFromAzureAd, dtoFromDb));
        }
Exemple #2
0
        public void DeleteUser(User user)
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }

            _context.Users.Remove(user);
        }
Exemple #3
0
        public void UpdateUser(User user)
        {
            foreach (var smartLockUser in user.SmartLockUsers)
            {
                smartLockUser.UserId = user.Id;
            }

            _context.Entry(user).State = EntityState.Modified;
        }
Exemple #4
0
        public void AddUser(User user)
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }

            foreach (var smartLockUser in user.SmartLockUsers)
            {
                smartLockUser.UserId = user.Id;
            }

            _context.Users.Add(user);
        }