How can I use linq extensions without lambda?
This example is purely for learning, otherwise I would have used Lambda expressions right away.

I would like to try and use the Where() extension method without lambda just to see how it would look, but I can't figure out how to get it to compile and work properly. The example makes no sense so don't bother trying to figure out any logic to it.

I basically just want to know if it is possible to use extensions methods without using lambda (for learning purposes only) and how that would look like in code.

What I'm getting confused with is the Where() condition takes in a Func<int,bool>, but the method returns an IEnumerable<int>? The way the Func is defined, it takes in one int and returns a bool. It would make more sense to me if this was Func<int, bool, IEnumberable<string>>




    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace Delegates
    {
        public class Learning
        {
            /// <summary>
            /// Predicates - specialized verison of Func
            /// </summary>
            public static void Main()
            {
                List<int> list = new List<int> { 1, 2, 3 };
    
                Func<int, bool> someFunc = greaterThanTwo;
                IEnumerable<int> result = list.Where(someFunc.Invoke(1));
    
            }
    
    
            static IEnumerable<int> greaterThanTwo(int arg, bool isValid)
            {
                  return new List<int>() { 1 };
            }
              
        }
    }





How can I use linq extensions without lambda?
===

This example is purely for learning, otherwise I would have used Lambda expressions right away.

I would like to try and use the Where() extension method without lambda just to see how it would look, but I can't figure out how to get it to compile and work properly. The example makes no sense so don't bother trying to figure out any logic to it.

I basically just want to know if it is possible to use extensions methods without using lambda (for learning purposes only) and how that would look like in code.

What I'm getting confused with is the Where() condition takes in a Func<int,bool>, but the method returns an IEnumerable<int>? The way the Func is defined, it takes in one int and returns a bool. It would make more sense to me if this was Func<int, bool, IEnumberable<string>>




    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace Delegates
    {
        public class Learning
        {
            /// <summary>
            /// Predicates - specialized verison of Func
            /// </summary>
            public static void Main()
            {
                List<int> list = new List<int> { 1, 2, 3 };
    
                Func<int, bool> someFunc = greaterThanTwo;
                IEnumerable<int> result = list.Where(someFunc.Invoke(1));
    
            }
    
    
            static IEnumerable<int> greaterThanTwo(int arg, bool isValid)
            {
                  return new List<int>() { 1 };
            }
              
        }
    }




