Example #1
0
		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();
				}
			}
		}
Example #2
0
		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();
				}
			}
		}