Esempio n. 1
0
        private async Task <User> GetUser(UserDraft userDraft)
        {
            var existingUser = await _userDataService.FirstOrDefault(u => u.Email == userDraft.Email);

            if (!(existingUser is null))
            {
                return(existingUser);
            }

            var user = new User
            {
                FirstName = userDraft.FirstName,
                LastName  = userDraft.LastName,
                Email     = userDraft.Email,
            };

            return(await _userDataService.Create(user));
        }