Ejemplo n.º 1
0
        public async Task TestAsync()
        {
            PackageParty participant = new PackageParty();
            Package      pac         = new Package();

            PackageItem packageItem = new PackageItem();

            pac.PackageItems.Add(packageItem);
            packageItem.Package = pac;

            PPP packagePartyParticipant = new PPP();

            packagePartyParticipant.PackageItem  = packageItem;
            packagePartyParticipant.PackageParty = participant;

            // make the relation bi-directional
            participant.ParticipatingPackages.Add(packagePartyParticipant);
            packageItem.PackagePartyParticipants.Add(packagePartyParticipant);

            using (ISession session = OpenSession())
            {
                await(session.SaveAsync(pac));
                await(session.FlushAsync());
            }

            using (ISession session = OpenSession())
            {
                await(session.DeleteAsync("from System.Object o"));
                await(session.FlushAsync());
            }
        }
Ejemplo n.º 2
0
        public void Test()
        {
            PackageParty participant = new PackageParty();
            Package      pac         = new Package();

            PackageItem packageItem = new PackageItem();

            pac.PackageItems.Add(packageItem);
            packageItem.Package = pac;

            PPP packagePartyParticipant = new PPP();

            packagePartyParticipant.PackageItem  = packageItem;
            packagePartyParticipant.PackageParty = participant;

            // make the relation bi-directional
            participant.ParticipatingPackages.Add(packagePartyParticipant);
            packageItem.PackagePartyParticipants.Add(packagePartyParticipant);

            using (ISession session = OpenSession())
            {
                session.Save(pac);
                session.Flush();
            }

            using (ISession session = OpenSession())
            {
                session.Delete("from System.Object o");
                session.Flush();
            }
        }
Ejemplo n.º 3
0
		public void Test()
		{
			PackageParty participant = new PackageParty();
			Package pac = new Package();

			PackageItem packageItem = new PackageItem();
			pac.PackageItems.Add(packageItem);
			packageItem.Package = pac;

			PPP packagePartyParticipant = new PPP();

			packagePartyParticipant.PackageItem = packageItem;
			packagePartyParticipant.PackageParty = participant;

			// make the relation bi-directional
			participant.ParticipatingPackages.Add(packagePartyParticipant);
			packageItem.PackagePartyParticipants.Add(packagePartyParticipant);

			using (ISession session = OpenSession())
			{
				session.Save(pac);
				session.Flush();
			}

			using (ISession session = OpenSession())
			{
				session.Delete("from System.Object o");
				session.Flush();
			}
		}