Exemple #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();
				}
			}
		}
Exemple #2
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();
				}
			}
		}
Exemple #3
0
 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());
             }
     }
 }
Exemple #4
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();
             }
     }
 }
Exemple #5
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();
				}
			}
		}