Example #1
0
        public ActionResult CreateTag(int modelId)
        {
            BlogEntry entry = Db.BlogEntries.Where(m => m.Id == modelId).FirstOrDefault();
            Tag tag = new Tag();
            tag.articleId = modelId;
            if (entry != null)
            {
                tag.article = entry;
            }

            return View(tag);
        }
Example #2
0
 public ActionResult CreateTag(Tag tag)
 {
     Db.Tags.Add(tag);
     Db.SaveChanges();
     return RedirectToAction("BlogIndex", new { id = tag.articleId });
 }