Ejemplo n.º 1
0
        public async Task ChangeSettings(ElanUser user, List <UserSettingViewModel> settings)
        {
            var settingsSet = _dataService.GetSet <ElanUserSetting>();

            foreach (var setting in settings)
            {
                var userSetting = new ElanUserSetting
                {
                    UserId         = user.Id,
                    Setting        = setting.Setting,
                    PrivacySetting = setting.PrivacySetting
                };
                settingsSet.Update(userSetting);
            }

            await _dataService.SaveDbAsync();
        }
Ejemplo n.º 2
0
        public async Task AddSettings(ElanUser newUser)
        {
            var searchSetting = new ElanUserSetting
            {
                UserId         = newUser.Id,
                Setting        = UserSetting.ProfileVisibility,
                PrivacySetting = PrivacySetting.Everyone
            };

            _dataService.GetSet <ElanUserSetting>().Add(searchSetting);

            var contentSetting = new ElanUserSetting
            {
                UserId         = newUser.Id,
                Setting        = UserSetting.ViewPosts,
                PrivacySetting = PrivacySetting.Everyone
            };

            _dataService.GetSet <ElanUserSetting>().Add(contentSetting);

            await _dataService.SaveDbAsync();
        }