public async Task <IActionResult> PutFrontCounterModel([FromRoute] int id, [FromBody] FrontCounterModel FrontCounterModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != FrontCounterModel.ID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemple #2
0
 public void Update(T exEntity)
 {
     dbSet.Attach(exEntity);
     context.Entry(exEntity).State = EntityState.Modified;
 }