Exemple #1
0
        public static IEnumerable <TReturnType> Enumerate <TReturnType>(this IReadonlyEntityGuidMappable <NetworkEntityGuid, TReturnType> collection, IReadonlyKnownEntitySet entitySet)
        {
            if (collection == null)
            {
                throw new ArgumentNullException(nameof(collection));
            }
            if (entitySet == null)
            {
                throw new ArgumentNullException(nameof(entitySet));
            }

            //Thread safe internally to iterate
            foreach (var element in entitySet)
            {
                if (collection.ContainsKey(element))
                {
                    yield return(collection.RetrieveEntity(element));
                }
            }
        }