Example #1
0
        public async Task <IActionResult> PutMThrmsattendance([FromRoute] long id, [FromBody] MThrmsattendance mThrmsattendance)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

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

            _context.MThrmsattendance.Add(mThrmsattendance);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetMThrmsattendance", new { id = mThrmsattendance.MThrmsattendanceId }, mThrmsattendance));
        }