public virtual ActionResult Delete(string id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } var role = _db.Roles.First(r => r.Name == id); var model = new RoleViewModel(role); if (role == null) { return HttpNotFound(); } return View(model); }
public virtual ActionResult Index() { var rolesList = new List<RoleViewModel>(); foreach(var role in _db.Roles) { var roleModel = new RoleViewModel(role); rolesList.Add(roleModel); } return View(rolesList); }