I have Fluent NHibernate set up in my ASP.NET MVC Project. For most of my records, I need to explicitly call Repository.Update(record) for the record to actually be persisted into the database.
I was playing around with my project, and I found out that one of my objects was persisting its information into the database without me calling Update. I thought that it was because I had called Update later on in the code, but that wasn't the case. I changed one of the fields in my object one line before I returned the View.
I set a breakpoint at Update (at the line before returning the view), and it never went there... If it makes a difference, I did call Update explicitly about 10 lines before.
I know this is a little vague since there's a ton of configuration and customization involved. I was just hoping for a nudge in the right direction or where to look.
Player myPlayer = this.PlayerRepository.GetById(id);
myPlayer.Location = "USA";
myPlayer.Age = 19;
this.PlayerRepository.Update(myPlayer);
...
...
...
myPlayer.Name = "John"; //this is being persisted without me actually calling Update
return View;