public IEnumerable <BankViewModel> GetByCode(string code) { if (string.IsNullOrWhiteSpace(code)) { throw new ValidationException("Enter code first before find."); } var codeLikeSpec = new CodeLikeSpecification(code); return(bankRepository.Find(codeLikeSpec).Select(p => BankViewModel.MapFromData(p)).ToList()); }
public IActionResult DeleteBank(long id) { Bank a = Bank_repo.Find(id); if (a == null) { return(NotFound()); } Bank_repo.Delete(a); return(Ok()); }
public ActionResult Edit(int id) { var bank = _bankRepository.Find(id); return(View(AutoMapper.Mapper.Map <Bank, BankModel>(bank))); }