I am facing a issue when i try to used string.format
on two db entities A, B and then using SqlFunctions.PatIndex
on them
IQueryable<Data> dataRecords = DbSet<Data> M_Data;
dataRecords = dataRecords.Where(c => SqlFunctions.PatIndex(sqlFilter, String.Format(A,B)) > 0);
its throwing exception Linq to entities does not recognize method string.Format
When i use AsEnumarable()
dataRecords = dataRecords.AsEnumerable().Where(c => SqlFunctions.PatIndex(sqlFilter, String.Format(A,B)) > 0).AsQueryable();
than it's throwing This function can only be invoked from LINQ to Entities
Can any one suggest how to do this.