Saturday, April 26, 2014

Using Predicate and Func in linq using c#

//Creation of Predicate

Predicate<String> checkGreterthen5= x=> x.Length>5;

List<String> oLst=new List<string>();



String str = oLst.Find(checkGreterthen5);


//Creation of Func

delegate Double CalcAreaPointer(int r);

CalcAreaPointer _obj= r => 3.14 * r*r;

Double Area=_obj(5);

Func<double,double,double> _obj2=(r,e)=> 3.14 *r*e;


Double Area2 = _obj2(5,2);

No comments :

Post a Comment

AJAX, asp,, and sql server security, IntemIndex, C#, Css, DataBinder.Eval, DataKeyNames, Datalist, Datapager, DataSet, DataTable, DropDownList, FindControl, gridview, JavaScript, jquery, Listview, Paging, Regex, RegularExpression, Repeater, Server side validation, Sql Server, timer, timercallback, Validation, XML, xmlnode, XPath