public void ControlRepositoryTest_Update_Success()
 {
     var cr = ControlRepository();
     Controls control = new Controls { ControlID = 3 , Code= "3000"};
     int actual = cr.Updates(control);
     Assert.AreEqual(expected:1,actual:actual);
 }
 public ActionResult Delete(Controls control)
 {
     InstantiateControlRepository();
     switch (_controlRepository?.Deletes(control: control))
     {
         case Success:
             return RedirectToAction(nameof(this.List));
     }
     return View(control);
 }
 public ActionResult Edit(Controls control)
 {
     InstantiateControlRepository();
     if (ModelState.IsValid)
     {
         switch (_controlRepository.Updates(control: control))
         {
             case Success:
                 return RedirectToAction(nameof(this.List));
         }
     }
     return View(control);
 }
 public ActionResult Create(Controls control)
 {
     if (ModelState.IsValid && control != null)
     {
         InstantiateControlRepository();
         switch (_controlRepository.Creates(control))
         {
             case Success:
                 return RedirectToAction(nameof(this.List));
         }
     }
     return View(control);
 }