コード例 #1
0
        static void AddData()
        {
            Stories story = new Stories()
            {
                Name  = "Life of Steve Jobs",
                Story = "Steve jobs was a frutitarian"
            };

            Stories.Add(story);

            story = new Stories()
            {
                Name  = "The Creation of Apple",
                Story = "Apple was created in 1976"
            };
            Stories.Add(story);

            story = new Stories()
            {
                Name  = "The Legend of Steve Jobs",
                Story = "Steve Jobs Was CEO of Apple"
            };

            Stories.Add(story);

            Comment comment = new Comment()
            {
                AStoriesComments = "Super generic comment"
            };

            story.Comments.Add(comment);

            Comment newComment = new Comment()
            {
                AStoriesComments = "A Random Comment"
            };

            story.Comments.Add(newComment);
        }
コード例 #2
0
ファイル: Repository.cs プロジェクト: jeffw773/CS295Lab2
 public static void AddStory(Stories story)
 {
     stories.Add(story);
 }
コード例 #3
0
        public static Stories GetStoryByName(string name)
        {
            Stories story = stories.Find(s => s.Name == name);

            return(story);
        }