Ejemplo n.º 1
0
        public async Task <ActionResult <paymentsource> > PostPaymentSource(paymentsource paymentsource)
        {
            _context.paymentsource.Add(paymentsource);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Getpaymentsource", new { id = paymentsource.paymentSourceId }, paymentsource));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> PutPaymentSource(int id, paymentsource paymentsource)
        {
            if (id != paymentsource.paymentSourceId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }