Subsonic 3 – SimpleRepository Update = Object reference not set to an instance of an object

subsonic3

Seems fairly straight forward and simple, I am doing the following and getting an 'Object reference not set to an instance of an object.' error. It's a very simple update.

   [AcceptVerbs(HttpVerbs.Post)][Authorize(Roles="admin")][ValidateInput(false)]
    public ActionResult SaveContent(int id, string content)
        {
            var page = _repos.Single<Models.Page>(p=>p.PageID == id);
            page.PageContent = content;
            _repos.Update(page);
             return RedirectToAction("Index",new { pagename=page.Name});
         }

I can see in the debugger that I am actually getting my object and updating it with new values but the _repos.Update(page); chokes every time.

Anyone else having this issue?

Best Answer

This is a bug of SubSonic 3.0.0.3, you should go to http://github.com/subsonic/SubSonic-3.0/tree/master, get the latest source code and build the dll yourself.