views:

24

answers:

0

Hi,

I am using the following code to update a record in my table:

                var usr = test.Data.user.SingleOrDefault(y => y.id == 1);
                usr.name = "test";
                usr.Save();

retrieving the row works perfectly but when I Save() I get a NullReferenceException breaking in the file database.cs line 412, which is the following code:

            Constraint c = new Constraint(ConstraintType.Where, tbl.PrimaryKey.Name)
                           {
                               ParameterValue = settings[tbl.PrimaryKey.Name],
                               ParameterName = tbl.PrimaryKey.Name,
                               ConstructionFragment = tbl.PrimaryKey.Name   
                           };

tbl.PrimaryKey is null at this place, which I think may be the problem. I do have a primary key set on the id field of my table. I'm also using the latest build from the git repo on Visual studio 2010. Anyone have an idea of what could be the problem?

Thank you.

EDIT:

Fixed by using the answer from nosynchro in this thread:

http://stackoverflow.com/questions/2286884/subsonic-3-and-mysql-removing-underscore-from-column-name-in-cleanup-method-ca

Hope this also get fixed in the git repo.