March 2008 Entries

Dynamic Ordering with LINQ

I was in need to order by a sort expression passed in to a function and since I am using LINQ to SQL the only supported way to do this is by having a switch clause and construct the orderby clause based on the sort input. This could result in a huge switch statement based on the total number of possible sort expressions. I wasn't very happy with that solution until I found this example. The DynamicQuery example is the sample I needed. In that example there is a Dynamic class which extends LINQ. These extension methods allows you to...

posted @ Monday, March 31, 2008 1:52 PM | Feedback (0)

HttpModules and HttpHandlers in IIS 7 in Integrated Mode

Today I was writing an HttpModule and was registering the module in the web.config under system.web. My module was not being called and I couldn't figure out why. After some trial and error I discovered the problem was that I was using IIS 7 in Integrated Mode which requires you to add your HttpModules and HttpHandlers under <system.webServer><modules></modules><handlers></handlers></system.webServer>. I added it under the right place and it worked. Then I was thinking my production server runs under IIS 6 (Windows 2003 Server) and it would suck to have to change it everytime I move the web.config so I decided to...

posted @ Monday, March 03, 2008 5:12 PM | Feedback (0)