public ActionResult MostUsed() { IQueryable <Tag> mostUsedTags = db.Tags. Include("Posts"). OrderByDescending(tag => tag.Posts.Count). Take(5); return(PartialView(TagModel.FromEntity(mostUsedTags))); }
// GET: Management/Tags public ActionResult Index() { return(View(TagModel.FromEntity(db.Tags.AsQueryable()))); }