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