예제 #1
0
        static void Main()
        {
            Comment comment1 = new Comment("Have a nice trip!");
            Comment comment2 = new Comment("Wow that´s awesome!");
            Comment comment3 = new Comment("Good night!");
            Comment comment4 = new Comment("May the Force be with you!");

            Posts post = new Posts(
                DateTime.Parse("18/07/209 18:32:02"),
                "Traveling to New Zealand",
                "I´m goin to visit this wonderful country!",
                12
                );
            Posts post2 = new Posts(
                DateTime.Parse("12/09/2019 12:12:12"),
                "Good night guys!",
                "See you tomorrow",
                4
                );

            post.AddComment(comment1);
            post.AddComment(comment2);
            post2.AddComment(comment3);
            post2.AddComment(comment4);

            Console.WriteLine(post);
            Console.WriteLine(post2);
        }
예제 #2
0
        static void Main(string[] args)
        {
            Comments comment1 = new Comments("Have a nice trip!");
            Comments comment2 = new Comments("Wow that's awesome!");

            Posts p1 = new Posts(DateTime.Parse("20/05/2020 20:47"), "Traveling to New Zeland", "I'm going to visit this wonderful country", 12);

            p1.AddComment(comment1);
            p1.AddComment(comment2);


            Comments comment3 = new Comments("Good night!");
            Comments comment4 = new Comments("May the force be with you!");

            Posts p2 = new Posts(DateTime.Parse("28/05/2020 22:50"), "Good night guys", "See you tumorrow", 5);

            p2.AddComment(comment3);
            p2.AddComment(comment4);

            Console.WriteLine(p1);
            Console.WriteLine(p2);

            Console.ReadKey();
        }