public TabularDataQueryOptions GetQueryOptions(IExternalTabularDataSource tabularDataSourceInfo)
        {
            if (tabularDataSourceInfo == null)
            {
                return(null);
            }

            return(GetQueryOptions(tabularDataSourceInfo.EntityName));
        }
        /// <summary>
        /// Adds Associated data source entry if it is valid and not already added to rule.
        /// </summary>
        /// <param name="tabularDataSourceInfo"></param>
        /// <returns>true if this operation resulted in change.</returns>
        public bool AddDataSource(IExternalTabularDataSource tabularDataSourceInfo)
        {
            if (tabularDataSourceInfo == null ||
                _tabularDataQueryOptionsSet.ContainsKey(tabularDataSourceInfo.EntityName))
            {
                return(false);
            }

            _tabularDataQueryOptionsSet.Add(tabularDataSourceInfo.EntityName, new TabularDataQueryOptions(tabularDataSourceInfo));
            return(true);
        }
        /// <summary>
        /// Adds select column to tabular datasource data call.
        /// </summary>
        /// <param name="tabularDataSourceInfo"></param>
        /// <param name="selectFieldName"></param>
        /// <returns></returns>
        internal bool AddSelect(IExternalTabularDataSource tabularDataSourceInfo, DName selectFieldName)
        {
            AddDataSource(tabularDataSourceInfo);

            var returnVal = false;

            returnVal |= _tabularDataQueryOptionsSet[tabularDataSourceInfo.EntityName].AddSelect(selectFieldName);
            returnVal |= tabularDataSourceInfo.QueryOptions.AddSelect(selectFieldName);

            return(returnVal);
        }
Beispiel #4
0
        public TabularDataQueryOptions(IExternalTabularDataSource tabularDataSourceInfo)
        {
            TabularDataSourceInfo = tabularDataSourceInfo;
            _selects = new HashSet <string>();
            var keyColumns = tabularDataSourceInfo.GetKeyColumns();

            foreach (var keyColumn in keyColumns)
            {
                _selects.Add(keyColumn);
            }

            _expandQueryOptions = new Dictionary <ExpandPath, ExpandQueryOptions>();
            ExpandDTypes        = new Dictionary <ExpandPath, DType>();
        }
        public TabularDataQueryOptions GetOrCreateQueryOptions(IExternalTabularDataSource tabularDataSourceInfo)
        {
            if (tabularDataSourceInfo == null)
            {
                return(null);
            }

            if (_tabularDataQueryOptionsSet.ContainsKey(tabularDataSourceInfo.EntityName))
            {
                return(_tabularDataQueryOptionsSet[tabularDataSourceInfo.EntityName]);
            }

            var newEntry = new TabularDataQueryOptions(tabularDataSourceInfo);

            _tabularDataQueryOptionsSet.Add(tabularDataSourceInfo.EntityName, newEntry);
            return(newEntry);
        }
 public bool HasTabualarDataSource(IExternalTabularDataSource tabularDataSourceInfo)
 {
     return(_tabularDataQueryOptionsSet.ContainsKey(tabularDataSourceInfo.EntityName));
 }
        internal Dictionary <ExpandPath, DType> GetExpandDTypes(IExternalTabularDataSource dsInfo)
        {
            var queryOptions = GetOrCreateQueryOptions(dsInfo);

            return(queryOptions.ExpandDTypes);
        }