Beispiel #1
0
        public async Task <IActionResult> PutCarrito(int id, data.Carrito carrito)
        {
            if (id != carrito.IdCarrito)
            {
                return(BadRequest());
            }

            try
            {
                new Solution.BS.Carrito(_context).Update(carrito);
            }
            catch (Exception)
            {
                if (!CarritoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Beispiel #2
0
        public async Task <ActionResult <data.Carrito> > PostCarrito(data.Carrito carrito)
        {
            new Solution.BS.Carrito(_context).Insert(carrito);

            return(CreatedAtAction("GetCarrito", new { id = carrito.IdCarrito }, carrito));
        }