Пример #1
0
        //public static IEnumerable<TSource> AsEnumerable<TSource>(this IEnumerable<TSource> source)
        public static IEnumerable <TProperty> AsEnumerable <TJoinEntity, TProperty>(this ManyToManyList <TJoinEntity, TProperty> source) where TProperty : Entity where TJoinEntity : class, IJoinEntity, new()
        {
            var enumarator = source.GetEnumerator();

            while (enumarator.MoveNext())
            {
                yield return(enumarator.Current);
            }
        }
Пример #2
0
        //public static IEnumerable<TResult> Select<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector);
        public static IEnumerable <TResult> Select <TJoinEntity, TProperty, TResult>(this ManyToManyList <TJoinEntity, TProperty> source, Func <TProperty, TResult> selector) where TProperty : Entity where TJoinEntity : class, IJoinEntity, new()
        {
            var enumarator = source.GetEnumerator();

            while (enumarator.MoveNext())
            {
                yield return(selector(enumarator.Current));
            }
        }