Пример #1
0
        public IEnumerable <AdTile> GetAdTiles(string basis, bool isTrue, int userid = 0)
        {
            var adTile         = new AdTile();
            var categories     = _categoryRepository.GetAll().ToList();
            var adTypes        = _adTypeRepository.GetAll().ToList();
            var attributes     = _attributeRepository.GetAll().ToList();
            var images         = _imageRepository.GetAll().ToList();
            var advertisements = userid != 0
                ? _advertisementRepository.GetAdsByUser(userid).ToList()
                : _advertisementRepository.GetAll().ToList();

            var adTiles  = new List <AdTile>();
            var totalAds = advertisements.Count();

            for (var index = 0; index < totalAds; index++)
            {
                if (userid != 0)
                {
                    switch (basis)
                    {
                    case "Deleted" when advertisements[index].Deleted != isTrue:
Пример #2
0
 public IEnumerable <AdType> GetAdTypes()
 {
     return(_adTypeRepository.GetAll());
 }