c# - How can i create a filter by with Linq? -
my mvc view displays following i perform filtering linq based on user selection can display filtered results only. my controller var products = db.products.asqueryable(); public class filterpageviewmodel { public int?[] man { get; set; } public int?[] size { get; set; } public int?[] color { get; set; } public decimal? minprice { get; set; } public decimal? maxprice { get; set; } public sorting sorting {get ; set; } public order order {get; set; } } public actionresult index(int? categoryid = 0, int? page = 0, filterpageviewmodel model = null) { //manufacturer ############################################# if (model.man != null) { foreach (int? in model.man) { if (i.hasvalue) { //do here } } } //size ###################################################### if (model.size != null) { ...