Example #1
0
        public async Task <ActionResult <autopayment_range> > Postautopayment_range(autopayment_range autopayment_range)
        {
            _context.autopayment_range.Add(autopayment_range);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Getautopayment_range", new { id = autopayment_range.id_autopayment_range }, autopayment_range));
        }
Example #2
0
        public async Task <IActionResult> Putautopayment_range(int id, autopayment_range autopayment_range)
        {
            if (id != autopayment_range.id_autopayment_range)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }