Esempio n. 1
0
        private static DataSource CreateSqlDataSource(
            string name,
            string sqlConnectionString,
            string tableOrViewName,
            string description,
            DataChangeDetectionPolicy changeDetectionPolicy     = null,
            DataDeletionDetectionPolicy deletionDetectionPolicy = null)
        {
            Throw.IfArgumentNullOrEmpty(name, nameof(name));
            Throw.IfArgumentNullOrEmpty(tableOrViewName, nameof(tableOrViewName));
            Throw.IfArgumentNullOrEmpty(sqlConnectionString, nameof(sqlConnectionString));

            return(new DataSource()
            {
                Type = DataSourceType.AzureSql,
                Name = name,
                Description = description,
                Container = new DataContainer()
                {
                    Name = tableOrViewName
                },
                Credentials = new DataSourceCredentials(sqlConnectionString),
                DataChangeDetectionPolicy = changeDetectionPolicy,
                DataDeletionDetectionPolicy = deletionDetectionPolicy
            });
        }
Esempio n. 2
0
 /// <summary>
 /// Creates a new DataSource to connect to a VM-hosted SQL Server database with change detection enabled.
 /// </summary>
 /// <param name="name">The name of the datasource.</param>
 /// <param name="sqlConnectionString">The connection string for the SQL Server database.</param>
 /// <param name="tableOrViewName">The name of the table or view from which to read rows.</param>
 /// <param name="changeDetectionPolicy">The change detection policy for the datasource.</param>
 /// <param name="description">Optional. Description of the datasource.</param>
 /// <returns>A new DataSource instance.</returns>
 public static DataSource SqlServerOnAzureVM(
     string name,
     string sqlConnectionString,
     string tableOrViewName,
     DataChangeDetectionPolicy changeDetectionPolicy,
     string description = null)
 {
     return(AzureSql(name, sqlConnectionString, tableOrViewName, changeDetectionPolicy, description));
 }
Esempio n. 3
0
 /// <summary>
 /// Creates a new DataSource to connect to an Azure SQL database with change detection enabled.
 /// </summary>
 /// <param name="name">The name of the datasource.</param>
 /// <param name="sqlConnectionString">The connection string for the Azure SQL database.</param>
 /// <param name="tableOrViewName">The name of the table or view from which to read rows.</param>
 /// <param name="changeDetectionPolicy">The change detection policy for the datasource.</param>
 /// <param name="description">Optional. Description of the datasource.</param>
 /// <returns>A new DataSource instance.</returns>
 public static DataSource AzureSql(
     string name,
     string sqlConnectionString,
     string tableOrViewName,
     DataChangeDetectionPolicy changeDetectionPolicy,
     string description = null)
 {
     Throw.IfArgumentNull(changeDetectionPolicy, nameof(changeDetectionPolicy));
     return(CreateSqlDataSource(name, sqlConnectionString, tableOrViewName, description, changeDetectionPolicy));
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the DataSource class.
 /// </summary>
 public DataSource(string name, DataSourceType type, DataSourceCredentials credentials, DataContainer container, string description = default(string), DataChangeDetectionPolicy dataChangeDetectionPolicy = default(DataChangeDetectionPolicy), DataDeletionDetectionPolicy dataDeletionDetectionPolicy = default(DataDeletionDetectionPolicy), string eTag = default(string))
 {
     Name        = name;
     Description = description;
     Type        = type;
     Credentials = credentials;
     Container   = container;
     DataChangeDetectionPolicy   = dataChangeDetectionPolicy;
     DataDeletionDetectionPolicy = dataDeletionDetectionPolicy;
     ETag = eTag;
 }