예제 #1
0
 public ActionResult Index()
 {
     Role role = new Role();
     role.Name = "Admin";
     //Adapter.RoleRepository.Insert(role);
     Adapter.Save();
     var roles = Adapter.RoleRepository.GetAll();
     return View();
 }
예제 #2
0
 public HttpStatusCode Update(int id, Role role)
 {
     if (role != null && ModelState.IsValid)
     {
         Adapter.RoleRepository.Insert(role);
         Adapter.Save();
         return HttpStatusCode.Created;
     }
     throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.BadRequest));
 }