I'm working on a widget and I need to get a pull X number of random products from the entire catalog for a particular store. Can someone recommend the best way to do this? Would it be a LINQ query?
You could, but how would you deal with the "random"? (Getting "all" products and doing random on the client side [controller] could be expensive if you have a lot of products)
If you need to only randomize products having ShowOnHomePage set, it's probably OK. But it does not deal with problem/performance of getting all products. The Product table has an index on ShowOnHomePage column. Depending on how often you need to randomize, maybe you could have a background process change which products have it set.