Unable to create a null constant value of type 'System.Int32[]'.

Viewed 9845

By using the following

  PagedData.Products = from p in db.Products
                                     where (from m in p.Manufacturers
                                            where model.man.Contains(m.ManufacturerID)
                                            select m).Any()
                                     where (from s in p.Sizes
                                            where model.size.Contains(s.SizeID)
                                            select s).Any()
                                     where (from c in p.Colors
                                            where model.color.Contains(c.ColorID)
                                            select c).Any()
                                     select p;

i get this error

Unable to create a null constant value of type 'System.Int32[]'. Only entity types, enumeration types or primitive types are supported in this context.

I got the point of the error, but i cannot figure out how should i fix it. The model.man model.size and model.color are arrays of integer, that may be also null.

2 Answers
Related