Whenever I attempt to use a simple repository to simply update a record, I get an object reference not set to an instance of an object error. I suspect that I am doing something incorrect, can anyone see a problem with the below lines of code for saving data to subsonic?
I'm using .Net 3.5, SQL Server 2008 and Subsonic 3.0.
Thanks for any help.
SimpleRepository repo = new SimpleRepository("Test", SimpleRepositoryOptions.RunMigrations);
//Add the test object
SimpleObject simple = new SimpleObject();
simple.TestString = "Test";
repo.Add(simple);
Console.WriteLine(simple.TestString);
//Reload the object and update it
SimpleObject simpleReloaded = repo.Single<SimpleObject>(simple.ID);
simpleReloaded.TestString = "Editted";
repo.Update(simpleReloaded);//This line seems to crash repeatedly
Console.WriteLine(repo.Single<SimpleObject>(simple.ID).TestString);