Search code examples
razorumbraco7

Umbraco Razor query - how to implement "does not contain"?


In Razor how would I write a query where property does not contain or excludes?

Basically looking for the opposite of:

Where(x => x.GetProperty<String>("myCategory").Contains(myString))

Solution

  • Uhm. Unless I'm missing something:

    Where(x => !x.GetProperty<String>("myCategory").Contains(myString))
    

    :-)