Filter many-to-many with DynamicQueryStringParameter RRS feed

  • Question

  • User-1453407501 posted

    I have a many-to-many relation on a 'device' table and a 'devicegroup' table with the intermediary table called 'device_devicegroups'. I'm presenting a list of device groups and when I click on a group I'd like to retrieve the list of devices in that group. Here's my list url '/Devices/List.aspx?DeviceGroupId=1'. Is there any way to get the DynamicQueryStringParameter to work in a m-to-m configuration, or am I going about this the wrong way. Thanks, Mike

    Tuesday, December 16, 2008 7:30 PM

All replies

  • User-1005219520 posted

    The ASP.NET Dynamic Data 4.0 Preview 2  should show up tomorrow ( Wed 17 December 2008) at http://www.codeplex.com/aspnet . It has a sample Support for many to many relationships in Entity Framework

    Tuesday, December 16, 2008 9:47 PM
  • User-1453407501 posted

    Any such luck for linq to sql? I know entities has better support for navigating m2m relations, but I had decided to go the linq2sql route for other reasons. Should I just ditch the templated approach?

    Wednesday, December 17, 2008 8:03 PM
  • User1641955678 posted

    My blog post has a bunch more info on this many to many support.  I think in theory it can be made to work with Linq to SQL, but it would certainly be harder.  The reason is that with L2S, the framework doesn't abstract out the 'junction table', so the field templates would need to do all the book keeping themselves to make it all work.  But in theory, I don't see why it couldn't be made to work with the right field template.


    Wednesday, December 17, 2008 8:22 PM