Click here to Skip to main content
15,888,071 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello Codeproject,

what it mean by this expression??
C#
public  enum YesNo : int
   {
       Yes = 1, No = 2
   }

   public class TestTableExt
   {

       public static System.Linq.Expressions.Expression<Func<Table4,bool>> IsEqual(YesNo i)
       {
           return ((a) => a.Num == (int?)i);
       }

   }

Can anybody help me on this to understand????????


Regards

Muhammed Abdussalam
Posted
Updated 11-Jan-12 5:31am
v2

Hi Salam6331,
I guess your question points this piece of code:
C#
public static System.Linq.Expressions.Expression<Func<Table4,bool>> IsEqual(YesNo i)
            {
                  return ((a) => a.Num == (int?)i);
            }

What really happens here is you define an expression tree that describes a lambda expression.
Later you can compile this into a delegate or method as you want by calling methods on the result obtained after calling IsEqual(YesNo.No) for e.g. .
 
Share this answer
 
Your question is not difficult, if you understand Func, your can answer it yourself. I suggest you do that:
Func<t,res> - Store anonymous methods in a generalized and simple way.

You can read more about Func here
C# Func Type[^]
Func on msdn[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900