예제 #1
0
        public async Task <Result <HttpResponseWithList <PermissionTypeDto> > > GetPermissionTypes(Pagination pagination = null)
        {
            try
            {
                var permissionsType = await _unitOfWork.PermissionTypeRepository.GetAllAsync();

                var permissionsTypeDto = _mapper.Map <IEnumerable <PermissionTypeDto> >(permissionsType);

                return(HttpResponseHelper.NewResult(HttpStatusCode.OK, HttpResponseHelper.NewHttpResponseList(elements: permissionsTypeDto, success: true)));
            }
            catch (Exception e)
            {
                return(HttpResponseHelper.NewResult(HttpStatusCode.InternalServerError, HttpResponseHelper.NewHttpResponseList <PermissionTypeDto>(error: e.Message)));
            }
        }