Codechef4u is a community for computer professionals,by computer professionals,just like you; who loves sharing and helping each others,Join them
Share your post


You can use contains () or any () extension method according to requirement, you can also use .StartsWith() or .EndsWith() please check following examples for same ,

//You can try Where clause with .contains() extension 
var query = from designation in SampleDbContext.Designation
             where designation.Title.Contains("/Engineer/")
             select designation;


//You can try contains() extension method  var queryWithDistinction = SampleDbContext.Designation.Where(D => D.Title.Contains("/Engineer/")).ToList();



//you can try .any() with contains() or .equals() when multiple columns values  var QueryUsingMany = SampleDbContext.Designation.Any(D => D.Title.Contains("Engineer") || D.Title.Contains("Consultant"));


//you can also use .StartsWith() 
//check following example
var queryStartsWith =SampleDbContext.Designation.Where(D => D.Title.StartsWith("Software")).ToList();


//check following example with .EndsWith(). var queryEndsWith = SampleDbContext.Designation.Where(D => D.Title.EndsWith("Engineer")).ToList();

Share your answer

Share as a guest

Please subscribe me to the CodeChef4U.

By creating your new answer, you agree to the privacy policy and terms of service.