Exemple #1
0
        public async Task <IActionResult> PutPayingFixedSumma(int id, PayingFixedSumma payingFixedSumma)
        {
            if (id != payingFixedSumma.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemple #2
0
        public async Task <ActionResult <PayingFixedSumma> > PostPayingFixedSumma(PayingFixedSumma payingFixedSumma)
        {
            _context.PayingFixedSumma.Add(payingFixedSumma);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (PayingFixedSummaExists(payingFixedSumma.Id))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetPayingFixedSumma", new { id = payingFixedSumma.Id }, payingFixedSumma));
        }