Archive

Posts Tagged ‘visual studio’

Simple Linq to Sql Enhancements with T4 Templating

October 23rd, 2009 Nathan 5 comments

I sometimes underestimate the power of the tools that come with visual studio. Usually this is because I’m ignorant of the fact they even exist until I see them used or read about them somewhere else. T4 text generation is no exception.  This is a very useful tool that’s built right into Visual Studio 2008 which I discovered while peeking at the new SubSonic 3 code when it came out. (Thanks Conery). :)

After spending a day drilling into T4 and learning how it works, I have to say that it was definitely time not wasted. I’ve since used it for tons of miscellaneous code generation projects including mostly data layer extensions. And with the help of the data provider specific templates in the SubSonic project, much of the schema extraction code has been provided for us through open source.

I’m a big fan of SubSonic, and I like to push it in all the shops I work with that aren’t already anchored down to another data framework. However, sometimes we still have to fall back to vanilla data layers like Linq to Sql (L2S), Entity Framework (EF), or straight up ADO.Net depending on the shop and its personalities. Having experience using SubSonic opens your eyes to some useful ways you can improve L2S and the others.

Read more…

Problems Installing Silverlight 3?

July 11th, 2009 Nathan No comments

So for those of you who have already played around with Silverlight 2 and saw the newer version Silverlight 3 release this week, you might have some issues installing it. I had the same problem on two different machines while trying to install the new runtimes. The first system was 32bit Windows XP with Silverlight2 Tools and Silverlight2 installed. The second was 64bit Windows 7 RC1 with the same Silverlight components.

Read more…

Regex Groups and Find/Replace Tagged Expressions

May 13th, 2009 Nathan No comments

Every once in awhile I have a need to use regular expressions in code. I love using them in Visual Studio find/replace. And one of my favorite features in the find/replace dialog is tagged expressions. This allows me to make a regular expression match and at the same time extract pieces of it for use in my replace with expression.

So today, I’m toying around with Regex and find a need to have the same behavior in code. The difference is, tagged expressions in code are referred to as matching groups. Normally you would use braces for your tagged expressions in a find/replace dialog; but in code, you would use parentheses instead. Read more…