public void WhenUseGetThenCanUsePersistToModify() { using (var scenario = new TaskSavedScenario(Sfi)) { using (var s = OpenSession()) using (var tx = s.BeginTransaction()) { var task = s.Get<Task>(scenario.TaskId); task.Description = "Could be something nice"; s.Executing(session => session.Persist(task)).NotThrows(); tx.Commit(); } } }
public async System.Threading.Tasks.Task WhenUseGetThenCanUsePersistToModifyAsync() { using (var scenario = new TaskSavedScenario(Sfi)) { using (var s = OpenSession()) using (var tx = s.BeginTransaction()) { var task = await(s.GetAsync <Task>(scenario.TaskId)); task.Description = "Could be something nice"; Assert.That(() => s.PersistAsync(task), Throws.Nothing); await(tx.CommitAsync()); } } }
public void WhenUseLoadThenCanUsePersistToModify() { using (var scenario = new TaskSavedScenario(Sfi)) { using (var s = OpenSession()) using (var tx = s.BeginTransaction()) { var task = s.Load <Task>(scenario.TaskId); task.Description = "Could be something nice"; s.Persist(task); Assert.That(() => s.Persist(task), Throws.Nothing); tx.Commit(); } } }
public void WhenUseLoadThenCanUsePersistToModify() { using (var scenario = new TaskSavedScenario(Sfi)) { using (var s = OpenSession()) using (var tx = s.BeginTransaction()) { var task = s.Load<Task>(scenario.TaskId); task.Description = "Could be something nice"; s.Persist(task); Assert.That(() => s.Persist(task), Throws.Nothing); tx.Commit(); } } }