public async Task <IActionResult> PutTwilioSmsModel([FromRoute] string id, [FromBody] TwilioSmsModel twilioSmsModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != twilioSmsModel.SmsSid) { return(BadRequest()); } _context.Entry(twilioSmsModel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TwilioSmsModelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
/// <summary> /// Add new entity /// </summary> /// <param name="entity">Entity</param> /// <returns>Task</returns> public async Task AddAsync(TEntity entity) { await _entities.AddAsync(entity); await _context.SaveChangesAsync(); }