public DatasetCommentsDataSource()
        {
            IEnumerable <EntitySet> entitySets = new List <EntitySet>();

            foreach (Container container in ContainerAliases)
            {
                var sets = EntitySetRepository.GetEntitySets(container.Alias, null) as List <EntitySet>;
                if (sets != null)
                {
                    entitySets = entitySets.Union(sets);
                }
            }

            var cds = new CommentsDataSource();
            IEnumerable <CommentEntry> comments = cds.SelectAll().Where(t => t.ParentType == ParentType.Dataset.ToString());

            _list = (from es in entitySets
                     join c in comments on es.EntitySetName equals c.DatasetId
                     select new DatasetComment(es.EntityId, es.Name, es.Description, es.CategoryValue, es.ContainerAlias, es.LastUpdateDate, es.EntitySetName, c.Subject, c.Username, c.Email, c.PostedOn));

            _list = _list.OrderBy(c => c.CommentDate)
                    .OrderBy(c => c.DatasetName)
                    .OrderBy(c => c.DatasetCategoryValue)
                    .OrderBy(c => c.DatasetContainerAlias);
        }
        public DatasetsDataSource()
        {
            _entities = new List <EntitySet>(EntitySetRepository.GetEntitySets().AsEnumerable());

            RateDataSource rds = new RateDataSource();

            _rates = from r in rds.SelectAll() select r;
        }
        public ViewReportDataSource()
        {
            var entities = new List <EntitySet>(EntitySetRepository.GetEntitySets().AsEnumerable());

            var rqds         = new RequestDataSource();
            var requestsList = rqds.Select();


            _entities = entities.ToDictionary(
                e => Helper.GenerateDatasetItemKey(e.ContainerAlias, e.EntitySetName),
                e => e);

            _requestsList = requestsList.ToDictionary(
                e => Helper.GenerateRequestKey(e.RowKey),
                e => e);
        }
 private IEnumerable <EntitySet> GetEntitySets(IEnumerable <string> containers)
 {
     containers = containers ?? from container in AllContainers select container.Alias;
     foreach (var container in containers)
     {
         IEnumerable <EntitySet> sets;
         _entitySets.TryGetValue(container, out sets);
         if (sets == null)
         {
             sets = EntitySetRepository.GetEntitySets(container, null);
             _entitySets.Add(container, sets);
         }
         foreach (var set in sets)
         {
             yield return(set);
         }
     }
 }