public IEnumerable <SeedSearchResultDto> Handle(SearchSeedQuery query) { return(_seedsRetreiver .GetAll() .Where(s => s.Description.Contains(query.Keyword)) .Select(s => new SeedSearchResultDto { CategoryId = s.SeedCategoryId, CategoryName = s.SeedCategory.Name, Description = s.Description, SeedId = s.Id })); }
public IEnumerable <GetSeedDto> Handle(GetSeedsRandomizedQuery query) { var seeds = _retreiveAllSeeds.GetAll().ToList(); var randomizedSeeds = seeds.OrderBy(s => Guid.NewGuid()); return(randomizedSeeds .Select(s => new GetSeedDto { CategoryId = s.SeedCategoryId, Description = s.Description, Id = s.Id }) .ToList()); }