Ejemplo n.º 1
0
        public async Task <ActionResult <Avaliability> > PostAvaliability(Avaliability avaliability)
        {
            _context.Avaliabilitys.Add(avaliability);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetAvaliability", new { id = avaliability.id }, avaliability));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> PutAvaliability(int id, Avaliability avaliability)
        {
            if (id != avaliability.id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }