Esempio n. 1
0
        public ActionResult GetAllAnnouncements()
        {
            var announcement = new Announcement("2020-09-14", "Krakow", "Fantastyka", "Test1", "Ziomek1", "jakisopis");

            db.AddAnnouncement(announcement);
            var allAnnouncements = db.GetAllAnnouncements();
            var jsonAnnouncement = new
            {
                date        = allAnnouncements[0].Date,
                city        = allAnnouncements[0].City,
                category    = allAnnouncements[0].Category,
                title       = allAnnouncements[0].Title,
                author      = allAnnouncements[0].Author,
                description = allAnnouncements[0].Description,
            };

            return(Json(jsonAnnouncement));
        }