MVC – Create a separate DbCompiledModel – Fix

When using a CE database for constructing MVC 3 Controllers you get the following error if using providerName=”System.Data.SqlServerCe.4.0″. “Unable to retreive metadata for ‘X.Y.Z’. Using the same DbCompiledModel to create contexts against different types of database servers is not supported….Continue Reading →

Checking events have fired in Unit Tests

When writing unit test to check events have fired you need to add an extra delegate that also gets called back. I was refactoring my PropertyChanged system and came up with the following: List<string> EventTracking = new List</string><string>(); [TestInitialize] public void Init()…Continue Reading →

Generic default or null

extension method to compare generics for default public static bool IsDefaultOrNull(this T value) { return EqualityComparer.Default.Equals(value, default(T)); }

Copy constructor and IClonable

A copy constructor is a constructor that creates a new object by making a copy of an existing object. ICloneable is a standard interface that you can implement, whereby you’ll add a Clone method to your class. The purpose of…Continue Reading →