Beispiel #1
0
        public async Task <ActionResult <PlateEpcRequest> > PostPlateEpc(PlateEpcRequest plateEpc)
        {
            _context.PlateEpc.Add(plateEpc);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetPlateEpc", new { id = plateEpc.Id }, plateEpc));
        }
Beispiel #2
0
        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());
        }
Beispiel #3
0
        public async Task <string> CreatePlateEpcAsync(PlateEpcRequest plan)
        {
            HttpResponseMessage response = await client.PostAsJsonAsync("api/platesepc", plan);

            response.EnsureSuccessStatusCode();

            return(response.StatusCode.ToString());
        }