I\'m having some difficulty writing a linq query that will check whether the consecutive digits in an integer are contained in the primary key of a table. So, suppose there
Try:
var results = from e in myDbContext.Employees
where SqlFunctions.StringConvert((double)e.Id).Contains(filter)
select e;
You can convert both to string and then do the query. In your case:
string filter = "456";
var results = from e in myDbContext.Employees
where e.Id.ToString().Contains(filter)
select e;