Beispiel #1
0
        public void TestIdGeneratorAttributeMappingOnIdentifier()
        {
            using (ISession session = base.OpenSession())
                using (ITransaction transaction = session.BeginTransaction())
                {
                    var employer = new Employer1();

                    Assert.That(employer.Id, Is.EqualTo(Guid.Empty));

                    session.Save(employer);

                    Assert.That(employer.Id, Is.Not.EqualTo(Guid.Empty));

                    transaction.Commit();
                }
        }
Beispiel #2
0
        public async Task TestIdGeneratorAttributeMappingOnIdentifierAsync()
        {
            using (ISession session = base.OpenSession())
                using (ITransaction transaction = session.BeginTransaction())
                {
                    var employer = new Employer1();

                    Assert.That(employer.Id, Is.EqualTo(Guid.Empty));

                    await(session.SaveAsync(employer));

                    Assert.That(employer.Id, Is.Not.EqualTo(Guid.Empty));

                    await(transaction.CommitAsync());
                }
        }
Beispiel #3
0
		public void TestIdGeneratorAttributeMappingOnIdentifier()
		{
			using (ISession session = base.OpenSession())
			using (ITransaction transaction = session.BeginTransaction())
			{
				var employer = new Employer1();

				Assert.That(employer.Id, Is.EqualTo(Guid.Empty));

				session.Save(employer);

				Assert.That(employer.Id, Is.Not.EqualTo(Guid.Empty));

				transaction.Commit();
			}
		}