public MySqlDbContext(
     string connection,
     BackendConfiguration backendConfiguration,
     MetadataSource metadataSource)
     : base(connection, backendConfiguration, metadataSource)
 {
 }
Пример #2
0
        private static void RunNewBackendTest()
        {
            var myWizard = new BackendManager.Wizard();

            var newConfig = new ConfigurationManager().CreateDefaultConfiguration();

            newConfig.Server = "xxx.xxx.xxx.xxx";
            newConfig.Port   = 3306;

            var superConfig = new BackendConfiguration()
            {
                DataBaseUserId       = "xxxxuser",
                DataBaseUserPassword = "******"
            };

            myWizard.TeardownBackend(newConfig, superConfig);
            myWizard.SetupNewBackend(newConfig, superConfig);
            var model = myWizard.ConnectWithBackend(newConfig);

            CreateTestModel(model);

            myWizard.PushDataToBackend(newConfig, model);

            UpdateTestModel(model);

            myWizard.PushDataToBackend(newConfig, model);

            DeleteFromTestModel(model);

            myWizard.LoadDataFromBackend(newConfig, model);

            var i = 0;
        }
 public MySqlDbContext(
     string connection,
     BackendConfiguration backendConfiguration,
     MetadataSource metadataSource)
     : base(connection, backendConfiguration, metadataSource)
 {
 }
        protected override void Init(string connectionString, string cacheKey, BackendConfiguration backendConfiguration, MetadataContainer metadataContainer, Assembly callingAssembly)
        {
            base.Init(connectionString, cacheKey, backendConfiguration, metadataContainer, callingAssembly);

            // try and stop Sitefinity from caching everything
            this.LevelTwoCache.EvictAll <GigyaSitefinityModuleSettings>();
        }
Пример #5
0
        public static BackendConfiguration GetBackendConfiguration()
        {
            BackendConfiguration backend = new BackendConfiguration();

            backend.Backend = "mssql";
            return(backend);
        }
Пример #6
0
        static DataContext()
        {
            MetadataContainer    = new DataMetadataSource().GetModel();
            BackendConfiguration = new BackendConfiguration();

            var connectionStringName = SiteSettings.Instance.ConnectionStringName;

            if (!string.IsNullOrEmpty(connectionStringName))
            {
                ConnectionStringName = connectionStringName;
            }

            //#if DEBUG
            // Debug data access by logging queries
            //BackendConfiguration.Logging.LogEvents = LoggingLevel.Normal;
            //BackendConfiguration.Logging.StackTrace = true;
            //BackendConfiguration.Logging.EventStoreCapacity = 10000;
            //BackendConfiguration.Logging.MetricStoreCapacity = 3600;
            //BackendConfiguration.Logging.MetricStoreSnapshotInterval = 1000;
            //BackendConfiguration.Logging.Downloader.EventBinary = true;
            //BackendConfiguration.Logging.Downloader.MetricBinary = true;
            //BackendConfiguration.Logging.Downloader.Filename = "C:\\Temp\\DataAccess";
            //BackendConfiguration.Logging.Downloader.MaxFileSizeKB = 1000;
            //BackendConfiguration.Logging.Downloader.NumberOfBackups = 3;
            //BackendConfiguration.Logging.Downloader.EventPollSeconds = 1;
            //BackendConfiguration.Logging.Downloader.MetricPollSeconds = 1;
            //#else
            BackendConfiguration.Logging.LogEvents = LoggingLevel.Errors;
            //#endif
        }
Пример #7
0
 public static BackendConfiguration GetBackendConfiguration()
 {
     BackendConfiguration backend = new BackendConfiguration();
     backend.Backend = "Oracle";
     backend.ProviderName = "Oracle.ManagedDataAccess.Client";
     return backend;
 }
Пример #8
0
		public static BackendConfiguration GetBackendConfiguration()
		{
			BackendConfiguration backend = new BackendConfiguration();
			backend.Backend = "MsSql";
			backend.ProviderName = "System.Data.SqlClient";
			return backend;
		}
		public static BackendConfiguration GetBackendConfiguration()
		{
			BackendConfiguration backend = new BackendConfiguration();
			backend.Backend = "MsSql";
			backend.ProviderName = "System.Data.SqlClient";
			return backend;
		}
Пример #10
0
		public static BackendConfiguration GetBackendConfiguration()
		{
			BackendConfiguration backend = new BackendConfiguration();
			backend.Backend = "ads";
			backend.ProviderName = "Advantage.Data.Provider";
			return backend;
		}
Пример #11
0
        public async Task ReadFileAsync(
            BackendConfiguration context,
            string id,
            Stream stream,
            long from,
            long to,
            long totalLength,
            CancellationToken cancellationToken = default(CancellationToken)
            )
        {
            using (var request = Request(context, HttpMethod.Get, $"api/backend", new {
                id,
                totalLength
            }))
            {
                var rangeHeader = new RangeHeaderValue(from, to).ToString();
                request.Headers.Add("Range", rangeHeader);
                Logger.LogDebug($"Range Header: {rangeHeader}");

                using (var response = await Client.SendAsync(
                           request,
                           HttpCompletionOption.ResponseHeadersRead,
                           cancellationToken))
                {
                    Logger.LogDebug($"Response started: Content-Length: {response.Content.Headers.ContentLength}");
                    response.EnsureSuccessStatusCode();


                    using (var responseStream = await response.Content.ReadAsStreamAsync())
                        await responseStream.CopyToAsync(stream, BUFFER_SIZE, cancellationToken);

                    Logger.LogDebug($"Complete");
                }
            }
        }
Пример #12
0
        public async Task <bool> RequestOnlineAsync(BackendConfiguration context, string id, CancellationToken cancellationToken = default(CancellationToken))
        {
            using (var request = Request(context, HttpMethod.Post, $"api/backend/online", new { id }))
                using (var response = await Client.SendAsync(request, cancellationToken))
                    response.EnsureSuccessStatusCode();

            return(true);
        }
Пример #13
0
        public static BackendConfiguration GetBackendConfiguration()
        {
            BackendConfiguration backend = new BackendConfiguration();

            backend.Backend      = "Oracle";
            backend.ProviderName = "Oracle.DataAccess.Client";
            return(backend);
        }
Пример #14
0
        public static BackendConfiguration GetBackendConfiguration()
        {
            BackendConfiguration backend = new BackendConfiguration();
            backend.Backend = "mysql";
            backend.ProviderName = "MySql.Data.MySqlClient";

            return backend;
        }
        private static BackendConfiguration GetBackendConfiguration()
        {
            var backendConfig = new BackendConfiguration();

            backendConfig.Backend      = "MySql";
            backendConfig.ProviderName = "MySql.Data.MySqlClient";
            return(backendConfig);
        }
Пример #16
0
        public static BackendConfiguration GetBackendConfiguration()
        {
            BackendConfiguration backend = new BackendConfiguration();

            backend.Backend      = "MySql";
            backend.ProviderName = "MySql.Data.MySqlClient";
            return(backend);
        }
Пример #17
0
        public static BackendConfiguration GetBackendConfiguration()
        {
            var backend = new BackendConfiguration { Backend = "MsSql", ProviderName = "System.Data.SqlClient" };
            backend.Logging.MetricStoreSnapshotInterval = 0;
            backend.Runtime.SupportConcurrentThreadsInScope = true;

            return backend;
        }
        public UploaderManager(ILogger <UploaderManager> logger, IOptions <AppsettingsModel> config, IElasticsearchRepository elasticsearchRepository, MinioClient minioClient)
        {
            this.logger        = logger;
            this.configuration = config.Value.Minio;

            this.eslasticRepository = elasticsearchRepository;
            this.minioClient        = minioClient;
        }
        public static BackendConfiguration GetBackendConfiguration()
        {
            var backend = new BackendConfiguration { Backend = "MySql", ProviderName = "MySql.Data.MySqlClient" };

            CustomizeBackendConfiguration(ref backend);

            return backend;
        }
Пример #20
0
        public Model.ModelContainer ConnectWithBackend(BackendConfiguration config)
        {
            var model = new Model.ModelContainer();

            UpdateTableSchema(model, config);

            return(model);
        }
Пример #21
0
        public static BackendConfiguration GetBackendConfiguration()
        {
            BackendConfiguration backend = new BackendConfiguration();

            backend.Backend      = "MsSql";
            backend.ProviderName = "System.Data.SqlClient";
            backend.Logging.MetricStoreSnapshotInterval = 0;
            return(backend);
        }
        private static BackendConfiguration GetBackEndConfig()
        {
            var config = new BackendConfiguration();

            config.Backend = "MySql";
            config.ProviderName = "MySql.Data.MySqlClient";

            return config;
        }
Пример #23
0
 public async Task <FileBackendConstants.OnlineStatus> GetOnlineStatusAsync(BackendConfiguration context, string id, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var request = Request(context, HttpMethod.Get, $"api/backend/online", new { id }))
         using (var response = await Client.SendAsync(request, cancellationToken))
         {
             response.EnsureSuccessStatusCode();
             return(await ReadAsJsonObjectAsync <FileBackendConstants.OnlineStatus>(response));
         }
 }
 public static BackendConfiguration GetBackendConfiguration()
 {
     var backendConfig = new BackendConfiguration()
     {
         Backend = "MsSql",
         ProviderName = "System.Data.SqlClient",                
     };
     return backendConfig;
 }
        public static BackendConfiguration GetBackendConfiguration()
        {
            var backend = new BackendConfiguration {
                Backend = "MySql", ProviderName = "MySql.Data.MySqlClient"
            };

            CustomizeBackendConfiguration(ref backend);

            return(backend);
        }
Пример #26
0
        public async Task <bool> CheckHealthAsync(BackendConfiguration context)
        {
            using (var request = Request(context, HttpMethod.Delete, $"api/healthcheck"))
                using (var response = await Client.SendAsync(request))
                {
                    response.EnsureSuccessStatusCode();
                }

            return(true);
        }
Пример #27
0
        public static BackendConfiguration GetBackendConfiguration()
        {
            BackendConfiguration backend = new BackendConfiguration();

            backend.Backend                             = "MySql";
            backend.ProviderName                        = "MySql.Data.MySqlClient";
            backend.Logging.LogEventsToTrace            = false;
            backend.Logging.MetricStoreSnapshotInterval = 0;
            return(backend);
        }
Пример #28
0
        private BackendConfiguration GetBackendConfiguration()
        {
            BackendConfiguration backend = new BackendConfiguration();

            backend.Backend = "MsSql";

            backend.ProviderName = "System.Data.SqlClient";

            return(backend);
        }
Пример #29
0
		public static BackendConfiguration GetBackendConfiguration()
		{
			BackendConfiguration backend = new BackendConfiguration();
			backend.Backend = "SQLite";
			backend.ProviderName = "System.Data.SQLite";
		
			CustomizeBackendConfiguration(ref backend);
		
			return backend;
		}
Пример #30
0
        public static BackendConfiguration GetBackendConfiguration()
        {
            var configuration = new BackendConfiguration
            {
                Backend      = "MySql",
                ProviderName = "MySql.Data.MySqlClient"
            };

            return(configuration);
        }
Пример #31
0
        public static BackendConfiguration GetBackendConfiguration()
        {
            BackendConfiguration backend = new BackendConfiguration();

            backend.Backend      = "MsSql";
            backend.ProviderName = "System.Data.SqlClient";

            backend.Runtime.CacheReferenceType = CacheReferenceType.Auto;

            return(backend);
        }
Пример #32
0
		public static BackendConfiguration GetBackendConfiguration()
		{
			BackendConfiguration backend = new BackendConfiguration();
			backend.Backend = "MsSql";
			backend.ProviderName = "System.Data.SqlClient";
			backend.Logging.MetricStoreSnapshotInterval = 0;
		
			CustomizeBackendConfiguration(ref backend);
		
			return backend;
		}
        private static BackendConfiguration ReadBackendConfiguration()
        {
            string configName           = Configuration.ReadSettings(Constants.BackendConfigurationName) ?? Constants.DefaultBackendConfigurationName;
            BackendConfiguration result = new BackendConfiguration {
                Backend = "mssql", ProviderName = "System.Data.SqlClient"
            };

            BackendConfiguration.MergeBackendConfigurationFromConfigFile(result, ConfigurationMergeMode.ConfigFileDefinitionWins, configName);

            return(result);
        }
Пример #34
0
 public static BackendConfiguration GetBackendConfiguration(BackendProvider backendProvider = null)
 {
     if (backendProvider != null)
     {
         var backend = new BackendConfiguration();
         backend.Backend      = backendProvider.BackendString;
         backend.ProviderName = backendProvider.ProviderName;
         return(backend);
     }
     return(null);
 }
Пример #35
0
 public async Task <Dictionary <string, string> > GetTagsAsync(BackendConfiguration context, string id, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var request = Request(context, HttpMethod.Get, $"api/backend/tag", new { id }))
     {
         using (var response = await Client.SendAsync(request, cancellationToken))
         {
             response.EnsureSuccessStatusCode();
             return(await ReadAsJsonObjectAsync <Dictionary <string, string> >(response));
         }
     }
 }
Пример #36
0
        public static BackendConfiguration GetBackendConfiguration()
        {
            BackendConfiguration backend = new BackendConfiguration();

            backend.Backend      = "MsSql";
            backend.ProviderName = "System.Data.SqlClient";

            CustomizeBackendConfiguration(ref backend);

            return(backend);
        }
Пример #37
0
        public static BackendConfiguration GetAzureBackendConfiguration()
        {
            var backend = new BackendConfiguration
            {
                Backend      = "Azure",
                ProviderName = "System.Data.SqlClient"
            };

            backend.Logging.MetricStoreSnapshotInterval = 0;
            return(backend);
        }
Пример #38
0
        public async Task <bool> SetTagsAsync(BackendConfiguration context, string id, Dictionary <string, string> tags, CancellationToken cancellationToken = default(CancellationToken))
        {
            using (var request = Request(context, HttpMethod.Post, $"api/backend/tag", new { id }))
            {
                request.Content = JsonContent(tags);
                using (var response = await Client.SendAsync(request, cancellationToken))
                    response.EnsureSuccessStatusCode();
            }

            return(true);
        }
Пример #39
0
		public static BackendConfiguration GetBackendConfiguration()
		{
			BackendConfiguration backend = new BackendConfiguration();
			backend.Backend = "MsSql";
			backend.ProviderName = "System.Data.SqlClient";
			backend.Logging.MetricStoreSnapshotInterval = 0;
			backend.ConnectionPool.IsolationLevel = IsolationLevel.ReadUncommitted;
		
			CustomizeBackendConfiguration(ref backend);
		
			return backend;
		}
Пример #40
0
        public static BackendConfiguration GetBackendConfiguration()
        {
            BackendConfiguration backend = new BackendConfiguration();

            backend.Backend                     = "MsSql";
            backend.ProviderName                = "System.Data.SqlClient";
            backend.Logging.LogEvents           = LoggingLevel.Verbose;
            backend.Logging.StackTrace          = true;
            backend.Logging.EventStoreCapacity  = 10000;
            backend.Logging.MetricStoreCapacity = 3600;
            return(backend);
        }
Пример #41
0
 public async Task DeleteFileAsync(
     BackendConfiguration context,
     string id,
     CancellationToken cancellationToken = default(CancellationToken)
     )
 {
     using (var request = Request(context, HttpMethod.Delete, $"api/backend", new { id }))
         using (var response = await Client.SendAsync(request, cancellationToken))
         {
             response.EnsureSuccessStatusCode();
         }
 }
Пример #42
0
    /// <summary>
    /// The method makes an asynchronous request of the backend configuration data.
    /// When the request is answered, the <see cref="OnConfigurationAvailable"/>
    /// callback will be called.
    /// The <see cref="BackendConfiguration"/> is cached in order to improve subsequent calls.
    /// To clear cached configuration use the <see cref="ClearBackendConfig"/> method.
    /// </summary>
    /// <param name="onConfigurationAvailable">The callback called when the configuration is available</param>
    public void RequestBackendConfig(OnConfigurationAvailable onConfigurationAvailable)
    {
        if (_backendConfig != null)
        {
            onConfigurationAvailable(_backendConfig);
            return;
        }

        // Request
        UnityWebRequest www;

        // Check if other config request is running
        if (_backendConfigRequest != null)
        {
            www = _backendConfigRequest.webRequest;
        }
        else
        {
            www = UnityWebRequest.Get(server + "/api/backend/configuration");
            _backendConfigRequest = www.SendWebRequest();
        }

        _backendConfigRequest.completed += (_) => {
            _backendConfigRequest = null;
#if UNITY_EDITOR
            if (verbose)
            {
                Debug.Log("text: " + www.downloadHandler.text);
            }
#endif
            if (www.responseCode == 200)
            {
                _backendConfig = BackendConfiguration.CreateFromJSON(GetResultJSON(www.downloadHandler.text));
                onConfigurationAvailable(_backendConfig);
            }
            else
            {
                string responseCodeMessage = $"Response Code: {www.responseCode}";
                if (www.responseCode == 500)
                {
                    responseCodeMessage += " - Internal server error.";
                    if (!string.IsNullOrEmpty(apiTokenString))
                    {
                        responseCodeMessage += "\nIf you are using simulator, consider not to use apiTokenString.";
                    }
                }

                Debug.LogError(responseCodeMessage);
                throw new System.Exception(responseCodeMessage);
            }
        };
    }
		public static BackendConfiguration GetBackendConfiguration()
		{
			BackendConfiguration backend = new BackendConfiguration();
			backend.Backend = "MsSql";
			backend.ProviderName = "System.Data.SqlClient";
			backend.Logging.LogEvents = LoggingLevel.All;
			backend.Logging.LogEventsToSysOut = true;
			backend.Logging.EventStoreCapacity = 10000;
			backend.Logging.MetricStoreCapacity = 3600;
			backend.Logging.Downloader.Filename = "c:\\testrun";
			backend.Logging.Downloader.EventBinary = true;
			backend.Logging.Downloader.MetricBinary = true;
		
			CustomizeBackendConfiguration(ref backend);
		
			return backend;
		}
 public WorkflowDurableInstancingDataContext(string connectionString, BackendConfiguration backend, MetadataSource metadataSource)
     : base(connectionString, backend, metadataSource)
 {
     var schemaHandler = GetSchemaHandler();
     string script = null;
     if (schemaHandler.DatabaseExists())
     {
         script = schemaHandler.CreateUpdateDDLScript(null);
     }
     else
     {
         schemaHandler.CreateDatabase();
         script = schemaHandler.CreateDDLScript();
     }
     if (!String.IsNullOrEmpty(script))
     {
         schemaHandler.ExecuteDDLScript(script);
     }
 }
Пример #45
0
        static DataContext() {
            MetadataContainer = new DataMetadataSource().GetModel();
            BackendConfiguration = new BackendConfiguration();

            #if DEBUG
            // Debug data access by logging queries
            BackendConfiguration.Logging.LogEvents = LoggingLevel.Normal;
            BackendConfiguration.Logging.StackTrace = true;
            BackendConfiguration.Logging.EventStoreCapacity = 10000;
            BackendConfiguration.Logging.MetricStoreCapacity = 3600;
            BackendConfiguration.Logging.MetricStoreSnapshotInterval = 1000;
            BackendConfiguration.Logging.Downloader.EventBinary = true;
            BackendConfiguration.Logging.Downloader.MetricBinary = true;
            BackendConfiguration.Logging.Downloader.Filename = "C:\\Temp\\DataAccess";
            BackendConfiguration.Logging.Downloader.MaxFileSizeKB = 1000;
            BackendConfiguration.Logging.Downloader.NumberOfBackups = 3;
            BackendConfiguration.Logging.Downloader.EventPollSeconds = 1;
            BackendConfiguration.Logging.Downloader.MetricPollSeconds = 1;
            #else
            BackendConfiguration.Logging.LogEvents = LoggingLevel.Errors;
            #endif
        }
		public EntitiesModel(string connection, BackendConfiguration backendConfiguration, MetadataSource metadataSource)
			:base(connection, backendConfiguration, metadataSource)
		{ }
		public EntitiesModel(BackendConfiguration backendConfiguration)
			:base(connectionStringName, backendConfiguration, metadataSource)
		{ }
		public OpenAccessMySqlSupermarketEntityModel(BackendConfiguration backendConfiguration)
			:base(connectionStringName, backendConfiguration, metadataSource)
		{ }
		public OpenAccessMySqlSupermarketEntityModel(string connection, BackendConfiguration backendConfiguration, MetadataSource metadataSource)
			:base(connection, backendConfiguration, metadataSource)
		{ }
Пример #50
0
		public Northwind(string connection, BackendConfiguration backendConfiguration, MetadataSource metadataSource)
			:base(connection, backendConfiguration, metadataSource)
		{ }
Пример #51
0
		public Northwind(BackendConfiguration backendConfiguration)
			:base(connectionStringName, backendConfiguration, metadataSource)
		{ }
Пример #52
0
		public static BackendConfiguration GetBackendConfiguration()
		{
			BackendConfiguration backend = new BackendConfiguration();
			backend.Backend = "mssql";
			return backend;
		}
Пример #53
0
		/// <summary>
		/// Allows you to customize the BackendConfiguration of EntitiesModel.
		/// </summary>
		/// <param name="config">The BackendConfiguration of EntitiesModel.</param>
		static partial void CustomizeBackendConfiguration(ref BackendConfiguration config);
Пример #54
0
		public static BackendConfiguration GetBackendConfiguration()
		{
			BackendConfiguration backend = new BackendConfiguration();
			backend.Backend = "MsSql";
			backend.ProviderName = "System.Data.SqlClient";
			backend.Logging.LogEvents = LoggingLevel.Normal;
			backend.Logging.MetricStoreSnapshotInterval = 0;
			backend.Logging.Downloader.Filename = "Log";
			backend.Logging.Downloader.EventText = true;
			return backend;
		}
		public SupermarketMySqlContext(string connection, BackendConfiguration backendConfiguration, MetadataSource metadataSource)
			:base(connection, backendConfiguration, metadataSource)
		{ }
		public SupermarketMySqlContext(BackendConfiguration backendConfiguration)
			:base(connectionStringName, backendConfiguration, metadataSource)
		{ }
		public OpenAccessMySQL(string connection, BackendConfiguration backendConfiguration, MetadataSource metadataSource)
			:base(connection, backendConfiguration, metadataSource)
		{ }
		public ElectronicStoreMySQLFluentModel(BackendConfiguration backendConfiguration)
            : base(connectionStringName, backendConfiguration, metadataSource)
		{ }
		public ElectronicStoreMySQLFluentModel(string connection, BackendConfiguration backendConfiguration, MetadataSource metadataSource)
			:base(connection, backendConfiguration, metadataSource)
		{ }
		public OpenAccessMySQL(BackendConfiguration backendConfiguration)
			:base(connectionStringName, backendConfiguration, metadataSource)
		{ }