How to pass Microsoft Exam 70-480 (HTML 5, CSS3 and JavaScript) in 30 days

20 September, 2013.

Before you continue reading this blog, you need to be aware of the following; This is not a “quick fix” or an “easy solution”. I have not discovered some secret formula to guarantee you pass with 100% marks every time. I am not trying to sell you anything. The exam is genuinely challenging and the only way you are going to pass is by working hard! You will not find any brain dumps here! If you’re afraid of working hard to achieve your goals, you best leave now … Still Here? Congratulations, you…

Continue reading

Effectively debugging WPF MVVM applications

13 September, 2013.

Being able to effectively debug any application is key to the success of an application. Every developer, no matter how good they are or how long they have been writing code, introduces bugs. Debugging is the process of identifying bugs and removing them. WPF applications can be particularly hard to debug, if you are not using the correct tools. This post attempts to help you utilise various free tools to help simplify the debugging process.Binding ErrorsBinding errors are very common in all WPF…

Continue reading

How to fix 'Project failed to build' error when adding an Entity Framework migration (add-migration)

06 September, 2013.

I recently spent several hours tearing my hair out try to figure out why Entity Framework was preventing me from adding a migration to my project. I made some very simple changes to my existing model (I’m developing using the Entity Framework Code First approach) and when trying to add a migration, I was presented with the following error message;But how can this be? For you see, my project does build…My project not only builds, but it runs and works just fine … (up until the point where Entity…

Continue reading

C# Writing unit tests with NUnit and Moq

30 August, 2013.

I’m assuming that you have seen the light, and that you are sold on the benefits (and indeed the drawbacks) of unit testing. I have read literally dozens of blog posts, watched many videos, and read several books about unit testing and the various approaches and frameworks. I have worked with several of these frameworks in both small and enterprise level applications, and I have found that (in my opinion at least) NUnit and Moq are great for helping to get simple tests written quickly and to a…

Continue reading

How to write more efficient and maintainable C# code

23 August, 2013.

When you are writing your C# applications, you are aware that you want to make your applications as efficient, maintainable, and as scalable as possible. These are some great keywords that look great on blog posts like this, but how do you actually set about achieving this goal? We will look at some simply guidelines which try to make this goal more achievable.Write single purpose methodsYour methods should have a single purpose… a single task to perform. For example, a single method should not…

Continue reading

WPF Entity Framework Code First migrations

16 August, 2013.

Recently I wrote a WPF application using Entity Framework Code First and released it into the wild. Shortly after, the business requirements changed and I had to make changes to the model. Thus, I was introduced to Code First migrations. I did a lot of research on Code First migrations and could only really find the most simple of examples, and almost robotic documentation on MSDN that provided minimal help. This post aims to provide a clearer view on migrations, and how to properly create them…

Continue reading

Using StructureMap setter injection to inject repositories into your View Model

09 August, 2013.

This short post is a follow on from an earlier series of posts that discussed how to achieve MVVM purity in WPF using Structure Map. You may want to check out those posts first before reading this post. However, if you just generally want to know how to do setter injection using Structure Map, you are in the right place!A ScenarioIt is very common in modern applications to have a repository that does the job of retrieving and saving data from/to your database. Your repository may look like this…

Continue reading

Getting started with SQLite and C#

07 August, 2013.

SQLite is a powerful, extremely light-weight transactional SQL database provider. SQLite is free and open source, and it does not require any server processes to handle it. SQLite is cross platform and runs on multiple architectures, making it ideal for use on the major operating systems such as Windows, Mac OS, Linux, and even lower powered devices such as PDAs, MP3 players etc.PrerequisitesIt is possible to get up and running with SQLite quickly in C#, by adding the System.Data.SQLite package…

Continue reading

WPF MVVM IoC containers - Part 2 of 2

02 August, 2013.

The ultimate goal of MVVM is to achieve true separation of concerns, meaning that the various elements of your project know nothing about each other. It’s virtually impossible to achieve this in an elegant way in WPF without some outside help. You are reading the second part of this blog post where we will discuss how to use an IoC container properly in a WPF MVVM application. It is assumed you have either read the first post, or are familiar with the concept of IoC/dependency injection with…

Continue reading