public static IQueryable<TEntity> Search<TEntity>(this IQueryable<TEntity> query, Expression<Func<TEntity, string>> expr, string needle)
{
return query.Where(u => EF.Functions.Like("u => u.Firstname", string.Format("%{0}%", needle)));
}
Is it possible to use the incoming variable "expr" at the place where I put the static "u => u.Firstname" now? I use it like this:
users.Search(u => u.Firstname, name);