private void EnsureTables(ITableEntityOperation tableEntityOperations) { if (!_created) { // for management tableEntityOperations.EnsureTable("LoginUser"); tableEntityOperations.EnsureTable("User"); tableEntityOperations.EnsureTable("Company"); tableEntityOperations.EnsureTable("Service"); tableEntityOperations.EnsureTable("Network"); tableEntityOperations.EnsureTable("Device"); tableEntityOperations.EnsureTable("Setting"); // for data tableEntityOperations.EnsureTable("CurrentData"); tableEntityOperations.EnsureTable("TimeSeries"); } _created = true; }
public void Setup(IDynamicConnectionStringResolver dynamicConnectionStringResolver, IDictionary <string, string> parameters) { string connectionString = null; if (!parameters.TryGetValue(ConnectionStringString, out connectionString)) { connectionString = dynamicConnectionStringResolver.Resolve(parameters[ConnectionNameString]).ConnectionString; } var cloudStorageAccount = CloudStorageAccount.Parse(connectionString); var cloudTableClient = cloudStorageAccount.CreateCloudTableClient(); TableEntityOperation = new AzureTableEntityOperations(cloudTableClient); TableName = parameters[TableString]; if (!TableName.All(char.IsLetterOrDigit)) { throw new ArgumentException("Invalid table name"); } }
public ServiceRepository(ITableEntityOperation tableEntityOperation) : base(tableEntityOperation) { }
public NetworkRepository(ITableEntityOperation tableEntityOperation) : base(tableEntityOperation) { }
public SettingOperations(ICloudStorageClientFactory cloudStorageClientFactory) { _tableEntityOperation = cloudStorageClientFactory.GetTableEntityOperation(); }
public UserRepository(ITableEntityOperation tableEntityOperation) : base(tableEntityOperation) { }
public SettingRepository(ITableEntityOperation tableEntityOperation) : base(tableEntityOperation) { }
public CompanyRepository(ITableEntityOperation tableEntityOperation) : base(tableEntityOperation) { }
public GenericRepository(ITableEntityOperation tableEntityOperation, string tableName) : base(tableEntityOperation) { _tableName = tableName; }
public NetworkOperations(ICloudStorageClientFactory cloudStorageClientFactory) { _tableEntityOperation = cloudStorageClientFactory.GetTableEntityOperation(); }
protected Repository(ITableEntityOperation tableEntityOperation) { _tableEntityOperation = tableEntityOperation; }