public ProviderDataSource AddDataSource(string name = null) { if (Handler.UsePowerBIGovernance && !PowerBI.PowerBIGovernance.AllowCreate(typeof(ProviderDataSource))) { return(null); } Handler.BeginUpdate("add data source"); var ds = ProviderDataSource.CreateNew(this, name); Handler.EndUpdate(); return(ds); }
public ProviderDataSource AddDataSource(string name = null) { if (!Handler.PowerBIGovernance.AllowCreate(typeof(ProviderDataSource))) { throw new PowerBIGovernanceException("Adding Data Sources to this Power BI Model is not supported."); } Handler.BeginUpdate("add data source"); var ds = ProviderDataSource.CreateNew(this, name); Handler.EndUpdate(); return(ds); }