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(); } }
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()); } }