Hi there,
I can't find anything similar to this in the forum, so I'll ask. I am trying to do a simple update to the object after inserting it. Below is the test that fails.
I'm using LLBLGen 1.6 Final, SelfServicing, with LinqADODS template in C# .Net 3.5
I have a table:
create table session (
session_id int identity(1,1) not null,
username varchar(20) not null,
guid varchar(100) null,
ts_session_started datetime not null default getdate(),
ts_session_extended datetime null,
ts_session_expired datetime null,
ts_session_ended datetime null,
)
I generated the code and do the following in my test.
[Test]
public void SessionUpdate()
{
var datasource = new LinqMetaData();
var session = new SessionEntity
{
Username = "Test Validate",
Guid = Guid.NewGuid().ToString(),
TsSessionStarted = DateTime.Now,
TsSessionExtended = DateTime.Now
};
session.Save();
session.Username = "new name";
session.Save();
var returnedSession = datasource.Session.Single(s => s.Guid == session.Guid);
Assert.AreEqual("new Name", returnedSession.Username);
}
All of my other entities update when saved as expected. What can cause this? The SQL Profiler shows that the update query isn't even sent, however, when inspecting the entity before and after .Save(), I can see that IsDirty is true before and false after. Just no update query happening.
I'd appreciate any ideas. This seems like such a fundamental failure, I'm afraid the answer is obvious and I'm doing something totally dumb.
Thanks!