EL02
EL02

Reputation: 322

Use or in entity framework

I want to use || in this example:

(from p in DbContext.Posts where p.Name == str || where p.Category == str
select new PostResponse(){
      //some properties here
}) 

but it gives me an error. Any way how I can achieve this?

Upvotes: 0

Views: 39

Answers (1)

POBIX
POBIX

Reputation: 106

Just remove the second where.

from p in DbContext.Posts where p.Name == str || p.Category == str

Upvotes: 3

Related Questions