Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        public IActionResult DeleteBank(long id)
        {
            Bank a = Bank_repo.Find(id);

            if (a == null)
            {
                return(NotFound());
            }
            Bank_repo.Delete(a);
            return(Ok());
        }
Esempio n. 3
0
        public ActionResult Edit(int id)
        {
            var bank = _bankRepository.Find(id);

            return(View(AutoMapper.Mapper.Map <Bank, BankModel>(bank)));
        }