public async Task <IActionResult> PutTipoPago(int id, PCTipoPago TipoPago) { if (id != TipoPago.Id) { return(BadRequest()); } _context.Entry(TipoPago).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TipoPagoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
// POST: api/TipoPago //[HttpPost] public async Task <ActionResult <PCTipoPago> > PostTipoPago(PCTipoPago TipoPago) { _context.PCTipoPago.Add(TipoPago); await _context.SaveChangesAsync(); //TODO aclarar con franklin return(CreatedAtAction("GetTipoPago", new { id = TipoPago.Id }, TipoPago)); }
public async Task <HttpResponseMessage> UpdateTipoPagoAsync(int id, PCTipoPago TipoPago) { var client = new HttpClient(); return(await client.PutAsync($"{baseUrl}api/TipoPago/{id}", getStringContentFromObject(TipoPago))); }
public async Task <HttpResponseMessage> InsertTipoPagoAsync(PCTipoPago TipoPago) { var client = new HttpClient(); return(await client.PostAsync($"{baseUrl}api/TipoPago", getStringContentFromObject(TipoPago))); }