Example #1
0
        public async Task <ActionResult <StockLocal> > PostStockLocal(StockLocal stockLocal)
        {
            _context.StockLocal.Add(stockLocal);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetStockLocal", new { id = stockLocal.Id }, stockLocal));
        }
Example #2
0
        public async Task <IActionResult> PutStockLocal(int id, StockLocal stockLocal)
        {
            if (id != stockLocal.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }