public async Task <ActionResult <PlateEpcRequest> > PostPlateEpc(PlateEpcRequest plateEpc) { _context.PlateEpc.Add(plateEpc); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPlateEpc", new { id = plateEpc.Id }, plateEpc)); }
public async Task <IActionResult> PutPlateEpc(int id, PlateEpcRequest plateEpc) { if (id != plateEpc.Id) { return(BadRequest()); } _context.Entry(plateEpc).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PlateEpc(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <string> CreatePlateEpcAsync(PlateEpcRequest plan) { HttpResponseMessage response = await client.PostAsJsonAsync("api/platesepc", plan); response.EnsureSuccessStatusCode(); return(response.StatusCode.ToString()); }