public async Task <IActionResult> PutAccountpayment2177(int id, Accountpayment2177 accountpayment2177)
        {
            if (id != accountpayment2177.Accountid)
            {
                return(BadRequest());
            }

            _context.Entry(accountpayment2177).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!Accountpayment2177Exists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <ActionResult <Accountpayment2177> > PostAccountpayment2177(Accountpayment2177 ap)
        {
            //          _context.Accountpayment2177.Add(ap);
            try
            {
                _context.Database.ExecuteSqlRaw("EXEC MAKE_ACCOUNT_PAYMENT " +
                                                "@PACCOUNTID = " + ap.Accountid +
                                                ", @PAMOUNT = " + ap.Amount);
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (Accountpayment2177Exists(ap.Accountid))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetAccountpayment2177", new { id = ap.Accountid }, ap));
        }