Combine a boolean condition with a Where clause in same query I'm trying to see if I can somehow reduce the length of this query.
I have a common part with the string.Compare(...), 

is IsProperty == true I would like to take all strings where Value is property, and false do the opposite.

What I have now is:    

List&lt;KeyValuePair&lt;int,string&gt;&gt; Groups = 
    isProperty ? model.Groups.Where(
      m =&gt; string.Compare(m.Value, "properties", true) == 0
    ).ToList() : 
    model.Groups.Where(
      m =&gt; string.Compare(m.Value, "properties", true) != 0
    ).ToList();


What I would like:

List&lt;KeyValuePair&lt;int,string&gt;&gt; Groups = 
    model.Groups.Where(
      m =&gt; string.Compare(m.Value, "properties", true) == 0 || !=0 //depending on isProperty
    ).ToList();


Not sure if it is all possible. (What I really want is to add it to the .Where when I pull values from DB)
Taking @VisualMelon's advice,

I converted it to this code, also replacing the compare with equal, maybe better.

List&lt;KeyValuePair&lt;int,string&gt;&gt; Groups = 
model.Groups.Where(
  m =&gt; string.Equals(m.Value, 
                     "properties", 
                     StringComparison.OrdinalIgnoreCase) == isProperty)
  .ToList();