예제 #1
0
        private void createNewUserProfile(string email)
        {
            try
            {
                var isUserExisting = _userProfileRepo.GetUserProfileById(email) != null;
                if (isUserExisting)
                {
                    return;
                }

                const string DefaultProfileImageUrl = "http://placehold.it/100x100"; // HACK: Default user profile image
                var          newUserProfile         = new Repositories.Models.UserProfile
                {
                    id                   = email,
                    CourseReminder       = Repositories.Models.UserProfile.ReminderFrequency.Once,
                    CreatedDate          = _dateTime.GetCurrentTime(),
                    ImageProfileUrl      = DefaultProfileImageUrl,
                    IsEnableNotification = true,
                    Name                 = email,
                    Subscriptions        = Enumerable.Empty <Repositories.Models.UserProfile.Subscription>()
                };
                _userProfileRepo.UpsertUserProfile(newUserProfile);
                _logger.LogInformation($"Create new user profile { email } complete");
            }
            catch (Exception e)
            {
                _logger.LogCritical($"Can't create new userprofile { email }, error info: {e.ToString()}");
            }
        }
예제 #2
0
        private void createNewUserProfile(string email)
        {
            const string DefaultProfileImageUrl = "http://placehold.it/100x100";
            var          newUserProfile         = new Repositories.Models.UserProfile
            {
                id                   = email,
                CourseReminder       = Repositories.Models.UserProfile.ReminderFrequency.Once,
                CreatedDate          = _dateTime.GetCurrentTime(),
                ImageProfileUrl      = DefaultProfileImageUrl,
                IsEnableNotification = true,
                Name                 = email,
                Subscriptions        = Enumerable.Empty <Repositories.Models.UserProfile.Subscription>()
            };

            _userProfileRepo.UpsertUserProfile(newUserProfile);
        }
예제 #3
0
 private void createNewUserProfile(string email)
 {
     const string DefaultProfileImageUrl = "http://placehold.it/100x100";
     var newUserProfile = new Repositories.Models.UserProfile
     {
         id = email,
         CourseReminder = Repositories.Models.UserProfile.ReminderFrequency.Once,
         CreatedDate = _dateTime.GetCurrentTime(),
         ImageProfileUrl = DefaultProfileImageUrl,
         IsEnableNotification = true,
         Name = email,
         Subscriptions = Enumerable.Empty<Repositories.Models.UserProfile.Subscription>()
     };
     _userProfileRepo.UpsertUserProfile(newUserProfile);
 }