Exemplo n.º 1
0
        private void PopulatePosts()
        {
            andysPost = new Post{ Title = "Andy created this post ", CreatedBy = andy };
            georgesPost = new Post{ Title = "George created this post ", CreatedBy = george };

            postRepository.Save(andysPost);
            postRepository.Save(georgesPost);
        }
Exemplo n.º 2
0
        public void Index()
        {
            ActiveRecordStarter.CreateSchema();

            var andy = new User{ FirstName = "Andy", LastName = "Pike" };
            userRepository.Save(andy);

            var george = new User{ FirstName = "George", LastName = "Good" };
            userRepository.Save(george);

            var firstPost = new Post{ Title = "My First Post", Body = "This is the body of my post", CreatedBy = andy };
            postRepository.Save(firstPost);

            var secondPost = new Post { Title = "My Second Post", Body = "This is another one of my posts", CreatedBy = andy };
            postRepository.Save(secondPost);

            var thirdPost = new Post { Title = "My Third Post", Body = "Yet another post", CreatedBy = george };
            postRepository.Save(thirdPost);
        }