// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddTransient( ctx => { var options = new DbContextOptionsBuilder() .UseSqlServer(this.Configuration.GetConnectionString("Connection")) .Options; return(new DataContext(options)); }); services.AddSingleton <GenerateToken>(); services.AddTransient <ICharacterService, CharacterService>(); services.AddTransient <INotificationService, NotificationService>(); services.AddSingleton( typeof(ServicesSettings), options => { var service = new ServicesSettings(); this.Configuration.GetSection("Services").Bind(service); return(service); }); services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new Info { Title = "Ultra API", Version = "v1" }); }); services.AddAutoMapper(); services.AddHttpClient(); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); }
public Uploader(ITelegramBotClient bot, ILogger <Uploader> logger, IOptions <ServicesSettings> servicesSettings, IAmazonSQS sqsClient) { _bot = bot; _logger = logger; _sqsClient = sqsClient; _servicesSettings = servicesSettings.Value; }
// serializes the objects to XML file public void SerializeModels(string filename, ServicesSettings settings) { var xmls = new XmlSerializer(settings.GetType()); var writer = new StreamWriter(filename); xmls.Serialize(writer, settings); writer.Close(); }
public Converter(ITelegramBotClient bot, ILogger <Converter> logger, IOptions <ServicesSettings> servicesSettings, IAmazonSQS sqsClient, FFMpegService ffMpegService) { _bot = bot; _logger = logger; _sqsClient = sqsClient; _ffMpegService = ffMpegService; _servicesSettings = servicesSettings.Value; }
public AuthenticationService(IConfiguration configuration, JwtSettings jwtSettings, IAuthRepository authRepository) { _settings = new ServicesSettings { UserService = configuration["Services:UserService"] }; _jwtSettings = jwtSettings; _authRepository = authRepository; }
public ServiceClient(IHttpClient httpClient, IServiceAuthenticatorClient serviceAuthenticatorClient, ServicesSettings servicesSettings) { _httpClient = httpClient; _serviceAuthenticatorClient = serviceAuthenticatorClient; _servicesSettings = servicesSettings; foreach (var service in _servicesSettings.Where(x => x.Name.NotEmpty())) { _authenticatedServices[service.Name] = string.Empty; } }
public static DataSourcesQueueService CreateEmptyConfiguredDataSourceQueueService(NSCRegDbContext ctx) { var analysisRules = new StatUnitAnalysisRules(); var dbMandatoryFields = new DbMandatoryFields(); var validationSettings = new ValidationSettings(); var createSvc = new CreateService(ctx, analysisRules, dbMandatoryFields, validationSettings, StatUnitTypeOfSave.WebApplication); var editSvc = new EditService(ctx, analysisRules, dbMandatoryFields, validationSettings); var servicesConfig = new ServicesSettings(); return(new DataSourcesQueueService(ctx, createSvc, editSvc, servicesConfig, dbMandatoryFields)); }
public GenerateToken( IHttpClientFactory clientFactory, ServicesSettings servicesSettings, IConfiguration configuration) { this.configuration = configuration; this.clientFactory = clientFactory; this.servicesSettings = servicesSettings; /*this.serviceAttribute = servicesSettings.Services * .FirstOrDefault(s => s.Key.Equals("BlizzardApi", StringComparison.OrdinalIgnoreCase)).Value;*/ }
public void Initialize() { algosList = new List <AlgoDataDTO>(); instancesList = new List <InstanceDataDTO>(); _configBuilder = new ConfigBuilder(); User = new OAuthConsumer(_configBuilder.ReloadingManager.CurrentValue.AutomatedFunctionalTests.AlgoStore); Consumer = new ApiConsumer(_configBuilder.ReloadingManager.CurrentValue.AutomatedFunctionalTests.AlgoStore, User); BaseUrl = _configBuilder.ReloadingManager.CurrentValue.AutomatedFunctionalTests.Services; PrepareDependencyContainer(); }
public FileGenerationJob(NSCRegDbContext ctx, IConfiguration configuration, ServicesSettings servicesSettings, ILogger logger) { _ctx = ctx; _sampleFrameExecutor = new SampleFrameExecutor(ctx, configuration); Interval = servicesSettings.SampleFrameGenerationServiceDequeueInterval; _timeoutMilliseconds = servicesSettings.SampleFrameGenerationServiceCleanupTimeout; _rootPath = servicesSettings.RootPath; _sampleFramesDir = servicesSettings.SampleFramesDir; _logger = logger; }
private void button_login_curl_Click(object sender, EventArgs e) { ServicesSettings settings = new ServicesSettings(); settings.DrupalURL = textBox_url.Text; // settings.UseSessionID = checkBox_sessionID.Checked; // Login to drupal _curlCon = new Curl(settings.DrupalURL); if (_curlCon.Login(textBox_userName.Text, textBox_password.Text)) { DrutNETBase.sendLogEvent("Login to curl successful \n", "Sample", Enums.MessageType.Info); } }
public DataSourcesQueueController( NSCRegDbContext ctx, StatUnitAnalysisRules statUnitAnalysisRules, DbMandatoryFields mandatoryFields, ServicesSettings servicesSettings, ValidationSettings validationSettings) { _svc = new DataSourcesQueueService( ctx, new CreateService(ctx, statUnitAnalysisRules, mandatoryFields, validationSettings, StatUnitTypeOfSave.WebApplication), new EditService(ctx, statUnitAnalysisRules, mandatoryFields, validationSettings), servicesSettings, mandatoryFields); }
public DataSourcesQueueService(NSCRegDbContext ctx, CreateService createSvc, EditService editSvc, ServicesSettings config, DbMandatoryFields dbMandatoryFields) { _dbContext = ctx; _createSvc = createSvc; _editSvc = editSvc; _rootPath = config.RootPath; _uploadDir = config.UploadDir; _dbMandatoryFields = dbMandatoryFields; _statUnitDeleteService = new DeleteService(ctx); _elasticService = new ElasticService(ctx); }
public void Initialize() { algosList = new List <AlgoDataDTO>(); instancesList = new List <InstanceDataDTO>(); _configBuilder = new ConfigBuilder(); User = new OAuthConsumer(_configBuilder.ReloadingManager.CurrentValue.AutomatedFunctionalTests.AlgoStore); Consumer = new ApiConsumer(_configBuilder.ReloadingManager.CurrentValue.AutomatedFunctionalTests.AlgoStore, User); BaseUrl = _configBuilder.ReloadingManager.CurrentValue.AutomatedFunctionalTests.Services; var instanceDataConfigString = File.ReadAllText(InstanceDataConfigFile); InstanceConfig = JsonUtils.DeserializeJson <InstanceDataConfig>(instanceDataConfigString); PrepareDependencyContainer(); }
protected static void Initialize() { HttpClientMock = new Mock <IHttpClient>(); ServiceAuthenticatorClientMock = new Mock <IServiceAuthenticatorClient>(); ServiceAuthenticatorClientMock.Setup(x => x.AuthenticateAsync(Moq.It.IsAny <string>(), Moq.It.IsAny <Credentials>())) .ReturnsAsync(new JwtBasic { Token = "token" }); ServicesSettings = new ServicesSettings { new ServiceSettings { Title = ServiceName, Name = ServiceName } }; ServiceClient = new ServiceClient(HttpClientMock.Object, ServiceAuthenticatorClientMock.Object, ServicesSettings); }
private void button_login_Click(object sender, EventArgs e) { // Create a settings object to define connection settings. ServicesSettings settings = new ServicesSettings(); settings.DrupalURL = textBox_url.Text; // settings.UseSessionID = checkBox_sessionID.Checked; settings.EndPoint = textBox_endpoint.Text; settings.CleanURL = true; /*settings.UseKeys = true;//Not Implemented yet * //settings.Key = "03cfd62180a67dcbcb1be9a7f78dc726"; * settings.DomainName = "localhost";*/ // Create a connection object _serviceCon = new Services(settings); if (_serviceCon.Login(textBox_userName.Text, textBox_password.Text)) { DrutNETBase.sendLogEvent("Login to services successful \n", "Sample", Enums.MessageType.Info); } }
public Cleaner(IAmazonSQS sqsClient, IOptions <ServicesSettings> servicesSettings, ILogger <Cleaner> logger) { _sqsClient = sqsClient; _logger = logger; _servicesSettings = servicesSettings.Value; }
public MovieService(IOptions <ServicesSettings> servicesSettings) { _servicesSettings = servicesSettings.Value; }
public ServiceService(IOptions <ServicesSettings> config, IServiceDao serviceDao) { _config = config.Value; _serviceDao = serviceDao; }
public TaxCalculatorTransportService(IHttpClientFactory httpClientFactory, IOptions <ServicesSettings> servicesSettings) { _httpClientFactory = httpClientFactory; _servicesSettings = servicesSettings.Value; }