示例#1
0
        public static void Perform(IDatabaseConnectionSettings connectionSettings)
        {
            var rest  = new RestConnector(connectionSettings);
            var flwor = new Flwor(new XdmpNodeDelete(FnDoc.AllDocuments.Query));

            rest.Submit(flwor.Query);
        }
示例#2
0
 /// <summary>
 /// Creating our auth controller
 /// </summary>
 /// <param name="helloWorldUser"></param>
 /// <param name="dataAccess"></param>
 /// <param name="dbConnectionSettings"></param>
 public AuthController(IHelloWorldParameters helloWorldParams,
                       IHelloWorldUser helloWorldUser,
                       IDataAccess <IDataParameterCollection> dataAccess,
                       IDatabaseConnectionSettings dbConnectionSettings)
 {
     this.DataAccess = dataAccess;
     this.DatabaseConnectionSettings = dbConnectionSettings;
     this.HelloWorldUser             = helloWorldUser;
 }
示例#3
0
 /// <summary>
 /// Creating a new instance of the session handler
 /// </summary>
 /// <param name="dataAccess"></param>
 /// <param name="dbConnectionSettings"></param>
 /// <param name="helloWorldParams"></param>
 /// <param name="helloWorldUser"></param>
 public SessionHandler(IDataAccess <IDataParameterCollection> dataAccess,
                       IDatabaseConnectionSettings dbConnectionSettings,
                       IHelloWorldParameters helloWorldParams,
                       IHelloWorldUser helloWorldUser)
 {
     this.DataAccess = dataAccess;
     this.DatabaseConnectionSettings = dbConnectionSettings;
     this.HelloWorldParams           = helloWorldParams;
     this.HelloWorldUser             = helloWorldUser;
 }
示例#4
0
        public void Initialize()
        {
            var browserMock = new Mock <IBrowser>();

            browserMock.Setup(x => x.GetPage(It.IsAny <Uri>()))
            .Returns(HtmlNode.CreateNode("To ogłoszenie jest nieaktualne"));
            _browser = browserMock.Object;

            var loggerMock = new Mock <ILogger>();

            loggerMock.Setup(x => x.Log(It.IsAny <LogType>(), It.IsAny <string>()));
            _logger = loggerMock.Object;

            _dbConnectionSettings = new DatabaseConnectionSettings("vps561493.ovh.net", 8086, "admin", "admin");
            _dbOfferRepository    = new DatabaseOfferRepository(_dbConnectionSettings);
            _sut = new OfferLinkCleanupActivity(_dbOfferRepository, _browser, _logger);
        }
示例#5
0
        public RestConnector(IDatabaseConnectionSettings connectionSettings)
        {
            var clientHandler = new HttpClientHandler()
            {
                Credentials             = new NetworkCredential(connectionSettings.UserName, connectionSettings.Password),
                PreAuthenticate         = true,
                AllowAutoRedirect       = false,
                UseCookies              = false,
                MaxConnectionsPerServer = 1
            };

            _client = new HttpClient(clientHandler)
            {
                Timeout     = TimeSpan.FromSeconds(TransactionTimeLimit),
                BaseAddress = new Uri($"http://{connectionSettings.Host}:{connectionSettings.Port}")
            };
        }
示例#6
0
 public DatabaseOfferRepository(IDatabaseConnectionSettings databaseConnectionSettings) : base(databaseConnectionSettings, ExtractOfferInfo)
 {
 }
 public DatabaseSearchCriteriaRepository(IDatabaseConnectionSettings databaseConnectionSettings) : base(databaseConnectionSettings, ExtractSearchModelInfo)
 {
 }
 public NpgsqlDbFactory(IDatabaseConnectionSettings connectionSettings) : base(CreateConnectionString(connectionSettings))
 {
 }
 private static string CreateConnectionString(IDatabaseConnectionSettings settings)
 {
     return($"User ID={settings.User};Password={settings.Password};Host={settings.Host};Port={settings.Port};Database={settings.DatabaseName};Pooling={settings.Pooling};");
 }
示例#10
0
 public DataRepository(IDatabaseConnectionSettings databaseConnectionSettings, Func <XDocument, T> extractionMethod)
 {
     DatabaseConnectionSettings = databaseConnectionSettings;
     RestConnector     = new RestConnector(DatabaseConnectionSettings);
     _extractionMethod = extractionMethod;
 }
示例#11
0
 public DatabaseHtmlDataRepository(IDatabaseConnectionSettings databaseConnectionSettings) : base(databaseConnectionSettings, ExtractHtmlDataInfo)
 {
 }
示例#12
0
 /// <summary>
 /// Create object-relational mapping for child entities.
 /// </summary>
 /// <param name="connectionSettings">Database connection settings.</param>
 protected ChildEntityTypeTableMapping(IDatabaseConnectionSettings connectionSettings)
     : base(connectionSettings)
 {
 }
示例#13
0
 /// <summary>
 /// Create object-relational mapping.
 /// </summary>
 /// <param name="connectionSettings">Database connection settings.</param>
 protected EntityTypeTableMapping(IDatabaseConnectionSettings connectionSettings)
 {
     this.connectionSettings = connectionSettings;
     this.namingConvention   = new DatabaseNamingConvention(connectionSettings.ServerType);
 }
示例#14
0
 public DatabaseLinkRepository(IDatabaseConnectionSettings databaseConnectionSettings) : base(databaseConnectionSettings, ExtractLinkInfo)
 {
 }
示例#15
0
 /// <summary>
 /// Create database context.
 /// </summary>
 /// <param name="options">Options.</param>
 /// <param name="logFactory">Log factory.</param>
 /// <param name="connectionSettings">Database connection settings.</param>
 public BaseDbContext(DbContextOptions options, ILoggerFactory logFactory, IDatabaseConnectionSettings connectionSettings = null)
     : base(options)
 {
     this.ConnectionSettings = connectionSettings;
     this.logFactory         = logFactory;
 }
示例#16
0
 public DatabaseUtilityRepository(IDatabaseConnectionSettings databaseConnectionSettings) : base(databaseConnectionSettings, null)
 {
 }
 public Migrator(IDatabaseConnectionSettings settings)
 {
     connectionString = buildPostgresConnectionString(settings);
     builder          = DeployChanges.To.PostgresqlDatabase(connectionString);
 }
 public DatabaseCommandRepository(IDatabaseConnectionSettings databaseConnectionSettings) : base(databaseConnectionSettings, ExtractCommandInfo)
 {
 }