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();
                }
            }));
        }
示例#2
0
 public IList <string> GetAllTestData()
 {
     return(dbPlugin.Execute(context =>
     {
         return context.TestTables.Select(x => x.TestTableData).ToList();
     }));
 }
示例#3
0
 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>();
         }
     }));
 }