コード例 #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)
 {
 }
コード例 #7
0
 public DatabaseSearchCriteriaRepository(IDatabaseConnectionSettings databaseConnectionSettings) : base(databaseConnectionSettings, ExtractSearchModelInfo)
 {
 }
コード例 #8
0
 public NpgsqlDbFactory(IDatabaseConnectionSettings connectionSettings) : base(CreateConnectionString(connectionSettings))
 {
 }
コード例 #9
0
 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)
 {
 }
コード例 #17
0
 public Migrator(IDatabaseConnectionSettings settings)
 {
     connectionString = buildPostgresConnectionString(settings);
     builder          = DeployChanges.To.PostgresqlDatabase(connectionString);
 }
コード例 #18
0
 public DatabaseCommandRepository(IDatabaseConnectionSettings databaseConnectionSettings) : base(databaseConnectionSettings, ExtractCommandInfo)
 {
 }