posts - 81, comments - 262, trackbacks - 0

August 2008 Blog Posts

Randomizing LINQ Queries

I've been using LINQ (with SqlMetal) a lot lately with MVC. I needed to grab a random single record. To my surprise there didn't appear to be a way to do this. I found an interesting post that confirms this and provides a workaround.  The workaround is to create a function which returns a newid. As the function can be mapped by SqlMetal the function will be available for sorting server side. Interesting… just a shame the function NEWID() isn't part of DLINQ.

posted @ Friday, August 29, 2008 10:37 PM | Feedback (7) | Filed Under [ Web Programming ]

MVC Preview 4 Account Controller and StructureMap Registry

I decided to use the MVC Preview 4 Account Controller with my MVC application. The application has been following the StoreFront sample application which is using StructureMaps. The trick in getting the two to work together is the following in configure()  ForRequestedType<IFormsAuthentication>() .TheDefaultIsConcreteType<FormsAuthenticationWrapper>();  ForRequestedType<MembershipProvider>() .TheDefaultIs(Membership.Provider);  In this way the web.config values are used for the provider. Without passing Membership.Provider (say by passing a new SQL provider) the configurations will be defaulted.

posted @ Saturday, August 23, 2008 6:04 PM | Feedback (4) | Filed Under [ Web Programming ]

Visual Studio – Expand All Regions and RockScroll

Scott Hanselman recently made RockScroll available to the public here, The add-on, if you haven't tried it, is great. One of its most useful features is highlighting in red a selected keyword both inline and in the scroll bar. It allows you to quickly, and visually find all instances of a term. The add-on has a minor bug though, it doesn't account for collapsed regions. So if regions are collapsed the scrolling will not line up with the code. David Yack posted,, a list of some shortcuts which are particularly handy for...

posted @ Friday, August 22, 2008 9:46 PM | Feedback (2) | Filed Under [ Web Programming Technical Computing ]

Happens Even to the Best

This made me feel a little bit better today. : )  

posted @ Saturday, August 16, 2008 3:07 PM | Feedback (6) |

Powered by:
Powered By Subtext Powered By ASP.NET