public async Task <string> RepaymantCredit(RepaymantCredit repaymantCredit) { foreach (var user in _context.CreditHistories.Where(x => x.IDPersonTakinCredit == repaymantCredit.Id)) { user.RemainingCredit -= repaymantCredit.ReturnMoney; } await _context.SaveChangesAsync(); return("Succesfully"); }
public async Task <IActionResult> RepaymantCredit(RepaymantCredit repaymantCredit) { var repay = await _repo.RepaymantCredit(repaymantCredit); return(Ok(repay)); }