Call method by condition
The lambda expression you pass to Where() is where you define the condition, so this is where it makes the most sense to put all the logic for this.
.Where(u =&gt; strict ? u.Nickname.Equals(login) : u.Nickname.Contains(login))

Or for higher performance you can conditionally pass a different lambda expression:
Func&lt;User,bool&gt; checker = strict
  ? (Func&lt;User,bool&gt;)((User u) =&gt; u.Nickname.Equals(login))
  : (Func&lt;User,bool&gt;)((User u) =&gt; u.Nickname.Contains(login));

...

.Where(checker)