I want to search my db with different keys. According to the input, there may be 1 key to 10 keys. Is there a way to add OR/AND clauses to my Linq query dynamically?
keys[k] // I have my keys in this array
var feedList = (from feed in ctx.Feed
where feed.content.contains(keys[0])
&& feed.content.contains(keys[1])
&& ... // continues with the keys.length
select new {
FeedId = feed.DuyuruId,
FeedTitle = feed.FeedTitle,
FeedContent = feed.FeedContents,
FeedAuthor = user.UserName + " " +User.UserSurname
}
IEnumerable
andIQueryable
extensions. – Arlana