Пример #1
0
        /// <summary>
        /// 批量新增
        /// </summary>
        /// <param name="permissions"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public async Task <ResponseMessage <bool> > AddRanageAsync(List <RoleEditRequest> permissions, CancellationToken cancellationToken)
        {
            var response = new ResponseMessage <bool>()
            {
                Extension = false
            };

            if (permissions.Count == 0)
            {
                throw new ArgumentNullException();
            }
            var list = _mapper.Map <List <Role> >(permissions);

            response.Extension = await _roleStore.AddRangeEntityAsync(list);

            return(response);
        }