This question is locked. New answers and comments are not allowed.
Hi,
Richard.
I build up a conditional linq statement based on input from a webpage. All works fine until i try and add both the following conditions simulatenously, at which point the webpage crashes the visual studio webserver everytime i try and run it.
the filters look as follows:
//filter 1:
if (InWebsiteUid != null) list = list.Where(x => x.Product.ProductCategories.Any(y => y.Category.CategoryTree.Websites.Any(z => z.Uid == InWebsiteUid)));
//filter 2:
if (NotInWebsiteUid != null) list = list.Where(x => !x.Product.ProductCategories.Any(y => y.Category.CategoryTree.Websites.Any(z => z.Uid == NotInWebsiteUid)));
Either one of the filters works fine, but when i try both together it crashes immediately.
Any suggestions?
Thanks,
Richard.