I am working on a hotel website
the website has 5 Check buttons ranging from 1 Hotel Star to 5
if none of the checkbuttons are enabled/clicked it should show all hotels
if one of the the 5 checkbuttons are enabled/clicked it should only show the hotel with that hotel star
if multiple checkbuttons are enabled/clicked it should only show those hotels with those stars;
I tried doing something like this
code:
if (dto.Star1)
rooms = rooms.Where(x => x.Stars == 1);
if (dto.Star2)
rooms = rooms.Where(x => x.Stars == 2);
if (dto.Star3)
rooms = rooms.Where(x => x.Stars == 3);
if (dto.Star4)
rooms = rooms.Where(x => x.Stars == 4);
if (dto.Star5)
rooms = rooms.Where(x => x.Stars == 5);
If one of the Checkbuttons is clicked/enabled it works perfect but if I click enable mutliple checkbottons it returns nothing
Help me out with this please.