예제 #1
0
        public async Task <ActionResult <audit_method_type> > Postaudit_method_type(audit_method_type audit_method_type)
        {
            _context.audit_method_types.Add(audit_method_type);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Getaudit_method_type", new { id = audit_method_type.id }, audit_method_type));
        }
예제 #2
0
        public async Task <IActionResult> Putaudit_method_type(int id, audit_method_type audit_method_type)
        {
            if (id != audit_method_type.id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }