Author Archive: David Anderson
I will come back and add more detail to this blog at a later date, but I was helping on MSDN forums and wrote this neat example for someone. It uses the dynamic language runtime and C# 4.0 to take…
Read more
This was inspired by this question on StackOverflow. First off, this is bad design unless you are designing some sort of setup application. But, specifically for those who still wish to proceed, here is how you do it. Download Example…
Read more
.NET Framework 2.0 does not support extension methods out of the box, because you cannot reference System.Core that was introduced in .NET 3.5. However, by adding a simple attribute class you can use extension methods in .NET 2.0 as well….
Read more
N-Tier Architecture Best Practices, Part 1: 2-Tier Architecture with just a Data Tier N-Tier Architecture Best Practices, Part 2: 3-Tier Architecture with interfaces and a Data Tier → this article N-Tier Architecture Best Practices, Part 3: DLinq / Linq to…
Read more
Before I start off on my lengthy post, this article is what sparked my interest. With that linked for you, this will be split into a 5 part blog series each part covering a specific type of n-tier architecture. If…
Read more
If you are still using .NET threads to do multi-threading in your applications (compared to the Task Parallel Library or something else), then it is often a mistake of developers on how they update their UI thread. First off, stay…
Read more
Download Example Code TasksWithThreadSafeEvents.zip In this article we will be using the following technologies: .NET 4.0 Windows Forms (WinForms) Task Parallel Library (TPL, part of .NET 4.0) In a nutshell, I am talking about writing thread-safe events for WinForms. I’ve…
Read more
I started learning the Entity Framework so I can add support for MySQL side-by-side MSSQL in FaultTrack Professional (issue tracking software I am developing), and I started to run into quite a few limitations with MySQL. #1Â Â Â Â DDL Generation (SSDLToMySQL.tt (VS))…
Read more
C# 3.0 introduced a new keyword, var. The var keyword allows you to utilize type inference at compile time which is a really cool feature. Here’s an extremely basic example. This should be self-explanatory: The compiler will resolve the local…
Read more
Did you know that the public access modifer in C# is essentially the equivalent to extern in C++? According to the C# 4.0 language specification, it is. People need to be careful with the public keyword. public in C# is not…
Read more