bool alreadyExists = myList.Any(x=> x.mobileNumber==mobileNoToSearch); if (alreadyExists) { //Do sending stuff }
List
List<string> list=new List<string>(); bool isInList=list.Contains("some string");
List<string> mobiles = new List<string>() {"077777777", "0777777778"}; if (mobiles.Contains("077777779")) { ... }
var user = UserList.FirstOrDefault(u => u.MobileNumber==mobileNoToSearch); if(user!=null) { //do something }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)