Hi All,
I have a relatively modest dataset (probably 20 main tables) but it's queried a lot of different ways.
Sometimes we show a product. Sometimes a product with it's picture. Sometimes a product with it's picture and comments. Sometimes a product with it's picture and all of the users that have the product and their pictures.
etc. (and by "etc." I mean "a LOT more permutations")
LINQ has facilities for making sure our queries grab all of the requisite information via the DataLoadOptions. However, if you want to do things like "just show me 5 comments" you're now using the AssociateWith method on DataLoadOptions, which is now (in my opinion) uncomfortably close to the DB to expose to, say, the codebeside files in your ASPX pages.
So - I'm curious how people handle this? Do they really build a model layer with methods like GetProductsWithPicturesAndUsersAndUserComments(int commentLimit, int pictureSize...
...with every permutation? Especially coming from a Rails background, where they figured this out, this solution seems very ugly. So, I'm hoping there's something else. Wondering what others' experiences are.
Thanks! Tom