public List <AdvertViewModel> GetAllUserAdverts(int userId) { var entityList = _repo.GetAllUserAdverts(userId); entityList = entityList.Where(ad => ad.State != "Deleted").OrderByDescending(ad => ad.Date).ToList(); return(entityList.Select(advert => _advertMapper.ViewMapper(advert)).ToList()); }
public IEnumerable <AdvertViewModel> GetAllAdverts() { var entityList = _repo.GetAllAdverts(); return(entityList.Select(ad => _mapper.ViewMapper(ad)).Where(ad => ad.State != "Deleted")); }