public GetSemanticResponse GetSemantic(int semanticId) { return(dbPlugin.Execute((context) => { try { var semantic = context.SemanticViews.FirstOrDefault(x => x.dashboardId == semanticId); var tableObjs = context.SemanticViewDetails.Where(x => x.SemanticViewId == semanticId).Select(x => new SemanticTableObject() { Alias = x.SemanticColumnAlias, Description = x.SemanticColumnDescription, Name = x.SemanticColumnName, Type = x.SemanticColumnType, TableName = x.TableName, }).ToList(); var response = new GetSemanticResponse() { name = semantic.SemanticViewName, dashboardId = semantic.dashboardId, Parent = 0, IsFolder = false, IsDeleted = false, widgets = tableObjs, Success = true }; return response; } catch (Exception ex) { return new GetSemanticResponse(); } })); }
public IList <string> GetAllTestData() { return(dbPlugin.Execute(context => { return context.TestTables.Select(x => x.TestTableData).ToList(); })); }
public List <GetDataSourceResponse> GetAllDataSource() { return(dbPlugin.Execute((context) => { try { //List<DataSourceDetails> dataSourceDetails = context.datasourcedetail.Where(p => p.IsActive == true).ToList(); List <DataSourceDetails> dataSourceDetails = context.datasourcedetail.ToList(); List <GetDataSourceResponse> datasourceresponse = dataSourceDetails.Select(p => new GetDataSourceResponse() { ConnectionString = p.ConnectionString, ConnectionType = p.ConnectionName, Success = true }).ToList(); return datasourceresponse; } catch (Exception ex) { return new List <GetDataSourceResponse>(); } })); }