// GET: Classes/Details/5
        public async Task<ActionResult> Details(int? id)
        {
            if(id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }

            const int maxItems = 10;

            Class @class = await db.Classes.Include(c => c.Teacher).Where(c => c.Id == id).FirstOrDefaultAsync();
            if(@class == null)
            {
                return HttpNotFound();
            }

            var workItemManager = new WorkItemManager(db);
            var workItems = (await workItemManager.GetClassWorkItems(@class)).Take(5);
            ViewBag.WorkItems = workItems;

            var announcementManager = new AnnouncementManager(db);
            var announcements = (await announcementManager.GetClassAnnouncements(@class)).Take(5);
            ViewBag.Announcements = announcements;

            return View(@class);
        }
        // GET: Announcements
        public async Task<ActionResult> Index(int? classId)
        {
            if(!classId.HasValue)
            {
                ViewBag.Title = "All announcements";
                return View(await db.Announcements.ToListAsync());
            }

            Class @class = await db.Classes.FindAsync(classId);
            if(@class == null)
            {
                ViewBag.Title = "Error";
                ModelState.AddModelError("error", string.Format("No class with id \"{0}\"", classId));
                return View();
            }

            ViewBag.ClassId = classId;
            ViewBag.Title = string.Format("Announcements for \"{0}\"", @class.Title);
            AnnouncementManager manager = new AnnouncementManager(db);
            return View(await manager.GetClassAnnouncements(@class));
        }