Example #1
0
        public async Task <ActionResult <Sallon> > PostSallon(Sallon sallon)
        {
            _context.Sallon.Add(sallon);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetSallon", new { id = sallon.Sallon_ID }, sallon));
        }
Example #2
0
        public async Task <IActionResult> PutSallon(int id, Sallon sallon)
        {
            if (id != sallon.Sallon_ID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }