Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi, i have a problem with following declaration:

C#
T Single <T> ( Expression <Func<T, bool>> expression, params Expression <Func <T, object>>[] includes ) where T : class;


Now i get it that T is a generic type but what i don't get are the "Expression" and "params" data types. Googling about them came up with nothing. Any explanation about them is very welcome.

Thanks in advance.
Posted
Updated 22-Aug-13 2:51am
v2
Comments
[no name] 22-Aug-13 8:52am    
http://msdn.microsoft.com/en-us/library/ms173144.aspx
http://msdn.microsoft.com/en-us/library/w5zay9db.aspx

1 solution

Neither the Expression or the params are datatypes: the former is similar to Func but returns a tree rather than a value (There is a good description here: http://stackoverflow.com/questions/793571/why-would-you-use-expressionfunct-rather-than-funct[^]).

params is a C# keyword that lets you specify a method parameter that takes a variable number of arguments. MSDN is your first resource here: http://msdn.microsoft.com/en-us/library/w5zay9db.aspx[^]
 
Share this answer
 
Comments
fjdiewornncalwe 22-Aug-13 9:43am    
+5. Clear and concise explanation.

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