public void Update(Foobar instance) { if (instance == null) { throw new ArgumentNullException("instance", "null"); } instance.UpdateDate = DateTime.Now; this._Repository.Update(instance); this._Repository.SaveChanges(); }
public ActionResult Create(string name, string[] categories) { var foobar = new Foobar { Name = name, Categories = string.Join(",", categories) }; if (ModelState.IsValid) { this.foobarService.Create(foobar); return RedirectToAction("Index"); } var items = this.CategorySelectListItems(); ViewBag.CategoryItems = items; return View(foobar); }