Beispiel #1
0
        public async Task <ActionResult <PointsTypeActive> > PostPointsTypeActive(PointsTypeActive pointsTypeActive)
        {
            _context.PointsTypeActive.Add(pointsTypeActive);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetPointsTypeActive", new { id = pointsTypeActive.PtaId }, pointsTypeActive));
        }
Beispiel #2
0
        public async Task <IActionResult> PutPointsTypeActive(Guid id, PointsTypeActive pointsTypeActive)
        {
            if (id != pointsTypeActive.PtaId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }