public int StructLinq_IFunction()
        {
            var predicate = new Int32IsEven();

            return(source
                   .ToStructEnumerable()
                   .Where(ref predicate, x => x)
                   .Count(x => x));
        }
        public int[] StructLinq_IFunction()
        {
            var predicate = new Int32IsEven();
            var selector  = new DoubleOfInt32();

            return(source.ToStructEnumerable()
                   .Where(ref predicate, x => x)
                   .Select(ref selector, x => x, x => x)
                   .ToArray(x => x));
        }
        public List <int> StructLinq_IFunction()
        {
            var predicate = new Int32IsEven();
            var selector  = new TripleOfInt32();

            return(source.ToStructEnumerable()
                   .Where(ref predicate, x => x)
                   .Select(ref selector, x => x, x => x)
                   .ToList(x => x));
        }
Exemplo n.º 4
0
        public int StructLinq_IFunction()
        {
            var sum       = 0;
            var predicate = new Int32IsEven();

            foreach (var item in source
                     .ToStructEnumerable()
                     .Where(ref predicate, x => x))
            {
                sum += item;
            }
            return(sum);
        }
Exemplo n.º 5
0
    public int StructLinq_ValueDelegate()
    {
        var predicate = new Int32IsEven();
        var items     = source
                        .ToStructEnumerable()
                        .Where(ref predicate, x => x);
        var sum = 0;

        foreach (var item in items)
        {
            sum += item;
        }
        return(sum);
    }