Ejemplo n.º 1
0
        public async Task <IActionResult> PutTblCommonBaseDatum(int id, TblCommonBaseDatum tblCommonBaseDatum)
        {
            if (id != tblCommonBaseDatum.CommonBaseDataId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <TblCommonBaseDatum> > PostTblCommonBaseDatum(TblCommonBaseDatum tblCommonBaseDatum)
        {
            _context.TblCommonBaseData.Add(tblCommonBaseDatum);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (TblCommonBaseDatumExists(tblCommonBaseDatum.CommonBaseDataId))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetTblCommonBaseDatum", new { id = tblCommonBaseDatum.CommonBaseDataId }, tblCommonBaseDatum));
        }