Esempio n. 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));
        }
Esempio n. 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());
        }
Esempio n. 3
0
        public async Task <string> CreatePlateEpcAsync(PlateEpcRequest plan)
        {
            HttpResponseMessage response = await client.PostAsJsonAsync("api/platesepc", plan);

            response.EnsureSuccessStatusCode();

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