public async Task<TEntity> UpdateAsync(TEntity entity) { if (entity == null) { throw new ArgumentNullException($"{nameof(UpdateAsync)} entity must not be null"); } try { _instaContext.Update(entity); await _instaContext.SaveChangesAsync(); return entity; } catch (Exception) { throw new Exception($"{nameof(entity)} could not be updated"); } }