Vibrant discussion about CSLA .NET and using the framework to build great business applications.
I have a businessbase object that I create with the data portal. I then set the properties equal to input values, then save it, and it runs the insert correctly. Next, I change a property again, then save again. It runs the insert again not the update. Is this how it is supposed to work? How do I make sure that after the object has been saved once it knows that now it should only do updates?
in debugging I noticed that the insert method is correctly loading the ID property, but once it goes back to the page the objects ID property is set to 0. I cannot figure out why the ID is getting lost.
The Save method actually returns a new object so your code should look like:
rootBO = rootBO.Save();
The returned object is marked as "Old" and next save will be an Update.
Jonny Bekkum, Norway
Also, if you you need the Id parameter from database.
If you are using stored procedure, make output parameter id, you need last inserted id.