public async Task <ActionResponse> RemoveAsync(IEnumerable <Permission> permissions)
        {
            try
            {
                _dbContext.Permissions.RemoveRange(permissions);
                await _dbContext.SaveChangesAsync();

                return(new ActionResponse());
            }
            catch
            {
                return(ActionResponse.FailedToAdd());
            }
        }
Ejemplo n.º 2
0
        public virtual async Task <ActionResponse> AddAsync(TEntity entity)
        {
            try
            {
                await _dbSet.AddAsync(entity);

                await _context.SaveChangesAsync();

                return(new ActionResponse());
            }
            catch
            {
                return(ActionResponse.FailedToAdd());
            }
        }