Repository.SearchExact C# (CSharp) Method

SearchExact() public method

public SearchExact ( string keyword, Expression getNameExpression ) : IQueryable
keyword string
getNameExpression Expression
return IQueryable
      public IQueryable<T> SearchExact(string keyword,
                                       Expression<Func<T,string>> getNameExpression)
      {
        var param = Expression.Parameter(typeof(T), "i");
        return db.GetTable<T>().Where(
                    Expression.Lambda<Func<T,bool>>(
                      Expression.Equal(
                        Expression.Invoke(
                          Expression.Constant(getNameExpression),
                          param),
                        Expression.Constant(keyword),
                      param));
      }
    }