Esempio n. 1
0
        /// <summary>
        /// Restful list of entities contained (it needs to never store its own objects, only cache references)
        /// </summary>
        public IEnumerable <T> EntitiesContained()
        {
            if (Count() > 0)
            {
                return(LiveCache.GetMany <T>(Birthmarks.Values.SelectMany(hs => hs)));
            }

            return(Enumerable.Empty <T>());
        }
Esempio n. 2
0
        /// <summary>
        /// Restful list of entities contained (it needs to never store its own objects, only cache references)
        /// </summary>
        public IEnumerable <T> EntitiesContained(string namedContainer)
        {
            if (String.IsNullOrWhiteSpace(namedContainer))
            {
                return(EntitiesContained());
            }

            if (Count(namedContainer) > 0)
            {
                return(LiveCache.GetMany <T>(Birthmarks[namedContainer]));
            }

            return(Enumerable.Empty <T>());
        }
Esempio n. 3
0
        /// <summary>
        /// List of entities contained sent back with which container they are in
        /// </summary>
        /// <returns>entities paired with their container names</returns>
        public IEnumerable <Tuple <string, T> > EntitiesContainedByName()
        {
            if (Count() > 0)
            {
                var returnList = new List <Tuple <string, T> >();

                foreach (var hashKeySet in Birthmarks)
                {
                    foreach (var value in LiveCache.GetMany <T>(hashKeySet.Value))
                    {
                        returnList.Add(new Tuple <string, T>(hashKeySet.Key, value));
                    }
                }

                return(returnList);
            }

            return(Enumerable.Empty <Tuple <string, T> >());
        }