public List <OptionModel> Handle(GetAllOptions request) { return(_optionsReader .GetAll() .Select(_mapper.Map <OptionModel>) .ToList()); }
private static int RunGetAndReturnExitCode(GetAllOptions options, LibraryService service) { IQueryable <PrintMedium> printMedia; if (options.Sorted) { printMedia = service.GetAllPrintMediaSorted(); } else { printMedia = service.GetAllPrintMedia(); } var allPrintMediaString = string.Join(Environment.NewLine, printMedia); Console.WriteLine(allPrintMediaString); return(0); }
public static GetAllOptions <TEntity, TEntityPrimaryKey> ResolveRepositoryGetAllOptions <TEntity, TEntityPrimaryKey, TResponseDto>( this IPaginatedRequestDto <TResponseDto> request) where TEntity : class, IEntity <TEntityPrimaryKey> where TResponseDto : class, IDto { if (request is null) { throw new ArgumentNullException(nameof(request)); } var options = new GetAllOptions <TEntity, TEntityPrimaryKey> { EntitiesToSkip = (request.PageIndex - 1) * request.PageSize, EntitiesToTake = request.PageSize }; return(options); }