Browse by Tags

All Tags » Orcas (RSS)

C#: My First Lambda Expression

I don't know about anyone else, but I found it annoying to have to put on three-lines of code (or one ugly one-line of code) for an IF statement for argument validation. Mostly, I want to check a simple condition and if true, throw an exception. Well...
Posted by adweigert | 5 comment(s)
Filed under: , ,

C#: My First Extension Method

I will find many, many uses for this ... maybe someone else will too! using System; using System.Diagnostics; internal static class StringExtensions { public static T ToEnum<T>( this string value) where T : struct { Debug .Assert(! string .IsNullOrEmpty...
Posted by adweigert | 1 comment(s)
Filed under: , ,
More Posts