Exemplo n.º 1
0
        public async Task <ActionResult <ProductCategory> > PostProductCategory(ProductCategory productCategory)
        {
            _context.ProductCategories.Add(productCategory);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetProductCategory", new { id = productCategory.Id }, productCategory));
        }
Exemplo n.º 2
0
        public async Task <ActionResult <Product> > PostProduct(Product product)
        {
            _context.Products.Add(product);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetProduct", new { id = product.Id }, product));
        }
Exemplo n.º 3
0
        public async Task <ActionResult <YD> > Post(YD yd)
        {
            _context.YD.Add(yd);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Get", new { id = yd.Id }, yd));
        }
Exemplo n.º 4
0
        public async Task <ActionResult <Table> > Post(Table table)
        {
            _context.Tables.Add(table);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Get", new { id = table.Id }, table));
        }
Exemplo n.º 5
0
        public async Task <ActionResult <Room> > Post(Room room)
        {
            _context.Rooms.Add(room);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Get", new { id = room.Id }, room));
        }