public IEnumerable <BikeDTO> GetBikes() { return(_bikeRepository.GetAll().Select(b => { return new BikeDTO { Id = b.Id, Name = b.Name, Type = b.Type, Parts = b.Parts.Select(p => { PartDTO part = new PartDTO { Id = p.Part.Id, Name = p.Part.Name, Description = p.Part.Description, Functionality = p.Part.Functionality.ToString(), IsOptional = p.Part.IsOptional, DominantParts = p.Part.DominantParts.Select(dp => dp.DominantPart.Name).ToList(), DependantParts = p.Part.DependantParts.Select(dp => dp.DependantPart.Name).ToList(), BikeId = p.Part.BikeParts.Select(b => b.BikeId).ToList() }; return part; }).OrderBy(p => p.Name).ToList() }; }).ToList()); }
public IEnumerable <BikeIndexDto> GetBikes() { return(_mapper.Map <IEnumerable <BikeIndexDto> >(_bikeRepository.GetAll())); }
public async Task <List <Bike> > GetAllBikesAsync() => await _bikeRepository.GetAll().ToListAsync();
public IEnumerable <Bike> GetAllBikes() // read all { return(_bikeRepository.GetAll()); }
public IEnumerable <Bike> GetBikes() { return(_bikeRepository.GetAll().OrderBy(b => b.Price)); }