Exemple #1
0
        public async Task <ActionResult <counterpart_type> > Postcounterpart_type(counterpart_type counterpart_type)
        {
            _context.counterpart_types.Add(counterpart_type);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Getcounterpart_type", new { id = counterpart_type.id }, counterpart_type));
        }
Exemple #2
0
        public async Task <IActionResult> Putcounterpart_type(int id, counterpart_type counterpart_type)
        {
            if (id != counterpart_type.id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }