public List <AdvertisementViewModel> GetAll() { var advs = _advertisementRepository.FindAll(); var advVms = Mapper.Map <List <Advertisement>, List <AdvertisementViewModel> >(advs.ToList()); return(advVms); }
public IEnumerable <Advertisement> Search(Expression <Func <Advertisement, bool> > predicate) { return(_advertisements.FindAll(predicate) .OrderByDescending(r => r.DateCreated)); }