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