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

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

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

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

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <IActionResult> Posttax_setting_types([FromBody] tax_setting_types tax_setting_types)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

            return(CreatedAtAction("Gettax_setting_types", new { id = tax_setting_types.id }, tax_setting_types));
        }