public IQueryable<TRow> WildcardSearchByInt<TRow>(string propertyName, string searchCritriea,IObjectSet<TRow> records) where TRow :class
{
return ((ObjectSet<TRow>)records).Where("CAST(it." + propertyName + " as System.String) LIKE @search", new ObjectParameter("search", searchCritriea.Replace("*", "%")));
}
This is code which is used for SQL Like Functionality for INT DataType in LINQ to ENTITIES
Sample
-------
IQueryable<process> processQuery = null;
if (process.processIDString != null && process.processIDString .Contains("*"))
{
processQuery = WildcardSearchByInt<process>("Process_ID", process.processIDString, processEntity);
}