Karl Gjertsen

Architect, Developer, Speaker, Bad Golfer,
Raygun brand ambassador and creator of Infiniforms

Monthly Archives: November 2015

Split web.config into multiple files

Having used web.config and app.config files for many years, today I learnt something new about them. You can split them into multiple files! This can be especially handy if your configuration files are getting too big. Splitting them is very straight forward and I will show you how to move your connection strings into a new file. Step #1: The first thing…

C#: Adding Shorts

Have you ever tried adding 2 shorts together? Did you know that a = a + b and a += b are different? I didn’t! A short is an alias of Int16, or a number that fits into 16 bits. This is half the size of an integer, which is an alias for Int32. short.MinValue = -32768 short.MaxValue = 32767…

String Interpolation in C# 6

Unlike some of the previous releases C# 6.0 isn’t a radical change from the current version of C#. But, it may still change the way you write code. A great example of this is String Interpolation. We originally started concatenating strings using the plus symbol: var myClass = new MyClass(); var fullName = “Full name: ” + myClass.FirstName + myClass.LastName; We then moved on to using String.Format: var myClass = new MyClass(); var fullName = String.Format(“full name: {0} {1}”, myClass.FirstName, myClass.LastName); Now, C# 6.0 gives us…