예제 #1
0
        public CreditCardAccountModel CreateEditCreditCard(CreditCardAccountModel model)
        {
            CreditCardEntity entity;

            //is update
            if (model.Id != default(long))
            {
                entity = CreditCardAccountRepository.GetById(model.Id);
                entity = Mapper.Map(model, entity);
            }
            else
            {
                entity = Mapper.Map <CreditCardEntity>(model);
                entity = CreditCardAccountRepository.Insert(entity);
            }
            CreditCardAccountRepository.Save();
            return(Mapper.Map <CreditCardAccountModel>(entity));
        }
예제 #2
0
 public IActionResult CreateEditCreditCard([FromBody] CreditCardAccountModel model)
 {
     return(Json(AccountService.CreateEditCreditCard(model)));
 }