c# - Working on lambda expression -


I'm squaring every integer in a list here's the code.

  class SomeIntgs {list & lt; Int & gt; NewList = New list & lt; Int & gt; (); Public listing & lt; Int & gt; Receive () {IEnumerable & lt; Int & gt; Intrs = new int [] (1, 2, 3, 4, 5, 6, 7, 8}; newList.AddRange (intrs); New Return;}}  

Error getting ()

  select something from stg = new SomeIntgs (); var qry = n to stg.get () (P => P * P);  

Error : "Lambda expression can not be converted to type bool."

Please help.

Help me, how can I handle lambda in general terms

lambda where specified in the section You how matches an item with your IQueryable Any member of the IQueryable who satisfies the expression you provide will be returned. (This is why your compiler is complaining about the balls).

As other people have mentioned, you can square up each item in the list. >

  var ints = new int [] (1,2,3,4,5,6,7,8}; Var intersection = ints. Selection (x = & gt; x * x); Var evenSquares = ints.Where (x => (x% 2) == 0). Select (x = & gt; x * x); // Only the numbers in the class // list  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -