Пример #1
0
        public async Task MappingIdGeneratorWithAttributeTakesPrecendenceOverMappingWithElementAsync()
        {
            using (ISession session = base.OpenSession())
                using (ITransaction transaction = session.BeginTransaction())
                {
                    var employer = new Employer2();

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

                    await(session.SaveAsync(employer));

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

                    await(transaction.CommitAsync());
                }
        }
Пример #2
0
		public void MappingIdGeneratorWithAttributeTakesPrecendenceOverMappingWithElement()
		{
			using (ISession session = base.OpenSession())
			using (ITransaction transaction = session.BeginTransaction())
			{
				var employer = new Employer2();

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

				session.Save(employer);

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

				transaction.Commit();
			}
		}