public AuthenticationController(
     IUnitOfWork unitOfWork,
     IAuthenticationService authService,
     IURIService URIService,
     ITokenService tokenService
     )
 {
     _unitOfWork   = unitOfWork;
     _authService  = authService;
     _URIService   = URIService;
     _tokenService = tokenService;
 }
예제 #2
0
        public static PagedResponse <T> CreatePagedResponse <T>(IURIService URIService, PageFilter filter, List <T> responses, string path)
        {
            if (filter == null || filter.PageNumber < 1 || filter.PageSize < 1)
            {
                return(new PagedResponse <T>(responses));
            }

            string nextPage = filter.PageNumber >= 1
            ? URIService.GetPaginationURI(path, new PaginationQuery(filter.PageNumber + 1, filter.PageSize)).ToString()
            : null;

            string previousPage = filter.PageNumber - 1 >= 1
            ? URIService.GetPaginationURI(path, new PaginationQuery(filter.PageNumber - 1, filter.PageSize)).ToString()
            : null;

            return(new PagedResponse <T>()
            {
                Data = responses,
                PageNumber = filter.PageNumber >= 1 ? filter.PageNumber : (int?)null,
                PageSize = filter.PageSize >= 1 ? filter.PageSize : (int?)null,
                NextPage = responses.Any() ? nextPage : null,
                PreviousPage = previousPage
            });
        }
예제 #3
0
 public OrganisationsController(IUnitOfWork unitOfWork, IMapper mapper, IURIService URIService)
 {
     _unitOfWork = unitOfWork;
     _mapper     = mapper;
     _URIService = URIService;
 }
예제 #4
0
 public UsersController(IUnitOfWork unitOfWork, IMapper mapper, IURIService URIService)
 {
     _unitOfWork = unitOfWork;
     _mapper     = mapper;
     _URIService = URIService;
 }