public override Expression <Func <Teacher, bool> > GetExpression() { if (!string.IsNullOrWhiteSpace(this.Keyword)) { this.ExpressionObject = x => x.Name.Contains(this.Keyword) || x.Email.Contains(this.Keyword); } this.ExpressionObject = ExpressionObject.And(this.GenerateBaseExpression()); return(this.ExpressionObject); }
public override Expression <Func <Student, bool> > GetExpression() { if (!string.IsNullOrWhiteSpace(Keyword)) { this.ExpressionObject = x => x.Name.Contains(Keyword) || x.Phone.Contains(Keyword) || x.Email.Contains(Keyword); } if (!string.IsNullOrWhiteSpace(Name)) { this.ExpressionObject = ExpressionObject.And(x => x.Name.Contains(Name)); } if (!string.IsNullOrWhiteSpace(Phone)) { this.ExpressionObject = ExpressionObject.And(x => x.Phone.Contains(Phone)); } Expression <Func <Student, bool> > baseExpression = this.GenerateBaseExpression(); ExpressionObject = ExpressionObject.And(baseExpression); return(this.ExpressionObject); }