Пример #1
0
		public void ParentWithNullableChild()
		{
			var book = new Book();
			var image = new ImageNullable();

			Assert.That(() => _books.Add(book), Throws.Nothing);
			image.IdBook = book.BookId;
			Assert.That(() => _imagesNullable.Add(image), Throws.Nothing);
		}
		public void ParentWithNullableChild()
		{
			Assert.That(() =>
			{
				using (var transaction = new TransactionScope())
				{
					var book = new Book();
					var image = new ImageNullable();

					Assert.That(() => _books.Add(book), Throws.Nothing);
					image.IdBook = book.BookId;
					Assert.That(() => _imagesNullable.Add(image), Throws.Nothing);
					transaction.Complete();
				}
			}, Throws.Nothing);
		}