Example #1
0
        //[AllowAnonymous]
        public async Task <IActionResult> Putinvd_machine([FromRoute] Guid id, [FromBody] invd_machine varinvd_machine)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(NoContent());
        }
Example #2
0
        //[AllowAnonymous]
        public async Task <IActionResult> Postinvd_machine([FromBody] invd_machine varinvd_machine)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.invd_machine.Add(varinvd_machine);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Getinvd_machine", new { id = varinvd_machine.invd_machineId }, varinvd_machine));
        }