The query I need to build is this:
query = query.Where(s =>
(
(s.Title.Contains(title1) && s.EpisodeTitle.Contains(episodeTitle1))
||
(s.Title.Contains(title2) && s.EpisodeTitle.Contains(episodeTitle2)))
);
The only issue is, s.Title and s.EpisodeTitle are dynamic.
Meaning that the following variables could be part of the query:
(string title1 = null,
string title2 = null,
string episodeTitle1 = null,
string episodeTitle2 = null,
string genre = null,
string directorName = null,
string releaseYear = null,
string seasonEpisode = null,
string showTypeDescription = null)
e.g.
query = query.Where(s =>
(
(s.DirectorName.Contains(directorName) && s.ShowTypeDescription.Contains(ShowTypeDescription))
||
(s.releaseYear.Contains(releaseYear) && s.genre.Contains(genre)))
);
In ANY type of combination.
How can I construct this query without having to take into account EVERY SINGLE possibility here?