public void AddApplicationSetting(ApplicationSettingValue applicationSetting)
        {
            if (CanAddApplicationSetting(applicationSetting).Any())
            {
                throw new InvalidOperationException();
            }

            _includedApplicationSettings.Add(new ApplicationSettingValueInProductOption(applicationSetting.Id));
        }
示例#2
0
 public TokenController(IUserService userService, IProjectService projectService, ICatapultEngineService catapultEngineService,
                        IConfiguration configuration, ApplicationSettingValue applicationSetting, ILogger <TokenController> logger)
 {
     _userService           = userService;
     _projectService        = projectService;
     _catapultEngineService = catapultEngineService;
     _configuration         = configuration;
     _applicationSetting    = applicationSetting;
     _logger = logger;
 }
        public IReadOnlyList <string> CanAddApplicationSetting(ApplicationSettingValue applicationSetting)
        {
            List <string> errors = new List <string>();

            if (applicationSetting == null)
            {
                errors.Add(ValidationMessage.MustSpecify("application setting"));
            }

            return(errors);
        }
        public static SettingData ToSettingData(this ApplicationSettingValue applicationSettingValue)
        {
            if (applicationSettingValue == null)
            {
                return(null);
            }

            return(new SettingData(
                       applicationSettingValue.ApplicationSetting.Setting.Type,
                       applicationSettingValue.ApplicationSetting.Setting.Code,
                       applicationSettingValue.Value));
        }
 public TokenControllerTests()
 {
     _userService           = new Mock <IUserService>();
     _projectService        = new Mock <IProjectService>();
     _catapultEngineService = new Mock <ICatapultEngineService>();
     _configuration         = new Mock <IConfiguration>();
     _applicationSetting    = new ApplicationSettingValue
     {
         EnableTwoFactorAuth = true
     };
     _logger = LoggerMock.GetLogger <TokenController>();
 }
 public ApplicationSettingController(
     IApplicationSettingService applicationSettingService,
     IMapper mapper,
     ApplicationSettingValue applicationSetting,
     IConfiguration configuration,
     ILogger <ApplicationSettingController> logger)
 {
     _applicationSettingService = applicationSettingService;
     _configuration             = configuration;
     _applicationSetting        = applicationSetting;
     _mapper = mapper;
     _logger = logger;
 }