private void FillDb()
		{
			using (ISession session = OpenSession())
			{
				var entity = new Parent {Id = 1};
				entity.AddNewChild();
				session.Save(entity);

				var entity2 = new Parent {Id = 2};
				session.Save(entity2);

				session.Flush();
			}
		}
Exemple #2
0
        private async Task FillDbAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            using (ISession session = OpenSession())
            {
                var entity = new Parent {
                    Id = 1
                };
                entity.AddNewChild();
                await(session.SaveAsync(entity, cancellationToken));

                var entity2 = new Parent {
                    Id = 2
                };
                await(session.SaveAsync(entity2, cancellationToken));

                await(session.FlushAsync(cancellationToken));
            }
        }
Exemple #3
0
        private void FillDb()
        {
            using (ISession session = OpenSession())
            {
                var entity = new Parent {
                    Id = 1
                };
                entity.AddNewChild();
                session.Save(entity);

                var entity2 = new Parent {
                    Id = 2
                };
                session.Save(entity2);

                session.Flush();
            }
        }