protected override void Init() { if (MetadataObject.Source == null && !(Parent is CalculatedTable)) { if (Model.DataSources.Count == 0) { StructuredDataSource.CreateNew(Model); } MetadataObject.Source = new TOM.MPartitionSource(); } base.Init(); }
public StructuredDataSource AddStructuredDataSource(string name = null) { if (Handler.CompatibilityLevel < 1400) { throw new InvalidOperationException(Messages.CompatibilityError_StructuredDataSource); } if (Handler.UsePowerBIGovernance && !PowerBI.PowerBIGovernance.AllowCreate(typeof(StructuredDataSource))) { return(null); } Handler.BeginUpdate("add data source"); var ds = StructuredDataSource.CreateNew(this, name); Handler.EndUpdate(); return(ds); }
public StructuredDataSource AddStructuredDataSource(string name = null) { if (Handler.CompatibilityLevel < 1400) { throw new InvalidOperationException(Messages.CompatibilityError_StructuredDataSource); } if (!Handler.PowerBIGovernance.AllowCreate(typeof(StructuredDataSource))) { throw new PowerBIGovernanceException("Adding Data Sources to this Power BI Model is not supported."); } Handler.BeginUpdate("add data source"); var ds = StructuredDataSource.CreateNew(this, name); Handler.EndUpdate(); return(ds); }
public CredentialImpl(StructuredDataSource dataSource) { this.dataSource = dataSource; }