Example #1
0
        public async Task <IActionResult> PutHistPerso1([FromRoute] string id, [FromBody] HistPerso1 histPerso1)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(NoContent());
        }
Example #2
0
        public async Task <IActionResult> PostHistPerso1([FromBody] HistPerso1 histPerso1)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.HistPerso1s.Add(histPerso1);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetHistPerso1", new { id = histPerso1.ZAUSW }, histPerso1));
        }