Ejemplo n.º 1
0
        public async Task <IActionResult> Putpropertysetup([FromRoute] int id, [FromBody] propertysetup propertysetup)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != propertysetup.id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Postpropertysetup([FromBody] propertysetup propertysetup)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.propertysetup.Add(propertysetup);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Getpropertysetup", new { id = propertysetup.id }, propertysetup));
        }