예제 #1
0
		protected override void OnSetUp()
		{
			using (ISession s = OpenSession())
			{
				using (ITransaction tx = s.BeginTransaction())
				{
					for (int i = 0; i < 10; i++)
					{
						var feed = new NewsFeed
						           	{
						           		Url = string.Format("Feed{0}Uri", i),
						           		Title = string.Format("Feed{0}", i),
						           		Status = (i % 2 == 0 ? 1 : 2)
						           	};
						s.Save(feed);

						for (int j = 0; j < 8; j++)
						{
							var item = new NewsItem
							           	{Title = string.Format("Feed{0}Item{1}", i, j), Status = (j % 2 == 0 ? 1 : 2), Feed = feed};
							s.Save(item);
						}
					}
					tx.Commit();
				}
			}
		}
예제 #2
0
        protected override void OnSetUp()
        {
            using (ISession s = OpenSession())
            {
                using (ITransaction tx = s.BeginTransaction())
                {
                    for (int i = 0; i < 10; i++)
                    {
                        var feed = new NewsFeed
                        {
                            Url    = string.Format("Feed{0}Uri", i),
                            Title  = string.Format("Feed{0}", i),
                            Status = (i % 2 == 0 ? 1 : 2)
                        };
                        s.Save(feed);

                        for (int j = 0; j < 8; j++)
                        {
                            var item = new NewsItem
                            {
                                Title = string.Format("Feed{0}Item{1}", i, j), Status = (j % 2 == 0 ? 1 : 2), Feed = feed
                            };
                            s.Save(item);
                        }
                    }
                    tx.Commit();
                }
            }
        }