Exemplo n.º 1
0
        public async Task <TEntity> Add(TEntity entity)
        {
            try
            {
                dbContext.Add(entity);
                await dbContext.SaveChangesAsync();

                return(entity);
            }
            catch (Exception ex)
            {
                throw new Exception($"Couldn't add entity: {ex.Message}");
            }
        }