Example #1
0
 public ActionResult Create(Tag tag)
 {
     if (ModelState.IsValid) {
         tagRepository.InsertOrUpdate(tag);
         tagRepository.Save();
         return RedirectToAction("Index");
     } else {
         return View();
     }
 }
Example #2
0
 public void InsertOrUpdate(Tag tag)
 {
     if (tag.TagId == default(int)) {
         // New entity
         context.Tags.Add(tag);
     } else {
         // Existing entity
         context.Tags.Attach(tag);
         context.Entry(tag).State = EntityState.Modified;
     }
 }
Example #3
0
 public void InsertOrUpdate(Tag tag)
 {
     throw new NotImplementedException();
 }