Ejemplo n.º 1
0
		protected override void OnSetUp()
		{
			base.OnSetUp();

			var person0 = new Person
							{
								Name = "Schorsch",
							};

			var person1 = new Person
							{
								Name = "Sepp",
							};

			var person2 = new Person
							{
								Name = "Detlef",
							};

			var forum0 = new Forum
							{
								Name = "Oof",
								Dollars = 1887.00,
							};

			var forum1 = new Forum
							{
								Name = "Rab",
								Dollars = 33.00,
							};

			var forum2 = new Forum
							{
								Name = "Main",
								Dollars = 42.42,
							};

			var group0 = new MemberGroup
							{
								Name = "Gruppe Bla",
								Members = new List<Person>(),
								Forums = new List<Forum>(),
							};
			group0.Members.Add(person0);
			group0.Forums.Add(forum0);
			group0.Forums.Add(forum1);

			var group1 = new MemberGroup
							{
								Name = "Gruppe Blub",
								Members = new List<Person>(),
								Forums = new List<Forum>(),
							};
			group1.Members.Add(person1);
			group1.Members.Add(person2);
			group1.Forums.Add(forum2);

			using (ISession session = OpenSession())
			{
				person0Id = (Guid) session.Save(person0);
				person1Id = (Guid) session.Save(person1);

				session.Flush();
			}
		}
Ejemplo n.º 2
0
        protected override void OnSetUp()
        {
            base.OnSetUp();

            var person0 = new Person
            {
                Name = "Schorsch",
            };

            var person1 = new Person
            {
                Name = "Sepp",
            };

            var person2 = new Person
            {
                Name = "Detlef",
            };

            var forum0 = new Forum
            {
                Name    = "Oof",
                Dollars = 1887.00,
            };

            var forum1 = new Forum
            {
                Name    = "Rab",
                Dollars = 33.00,
            };

            var forum2 = new Forum
            {
                Name    = "Main",
                Dollars = 42.42,
            };

            var group0 = new MemberGroup
            {
                Name    = "Gruppe Bla",
                Members = new List <Person>(),
                Forums  = new List <Forum>(),
            };

            group0.Members.Add(person0);
            group0.Forums.Add(forum0);
            group0.Forums.Add(forum1);

            var group1 = new MemberGroup
            {
                Name    = "Gruppe Blub",
                Members = new List <Person>(),
                Forums  = new List <Forum>(),
            };

            group1.Members.Add(person1);
            group1.Members.Add(person2);
            group1.Forums.Add(forum2);

            using (ISession session = OpenSession())
            {
                person0Id = (Guid)session.Save(person0);
                person1Id = (Guid)session.Save(person1);

                session.Flush();
            }
        }