Пример #1
0
        public virtual void HaberSil(HaberÖğesi haberÖğesi)
        {
            if (haberÖğesi == null)
            {
                throw new ArgumentNullException("haberÖğesi");
            }

            _haberÖğesiDepo.Sil(haberÖğesi);
            _olayYayınlayıcı.OlaySilindi(haberÖğesi);
        }
Пример #2
0
        public virtual void HaberGüncelle(HaberÖğesi haberler)
        {
            if (haberler == null)
            {
                throw new ArgumentNullException("haberler");
            }

            _haberÖğesiDepo.Güncelle(haberler);
            _olayYayınlayıcı.OlayGüncellendi(haberler);
        }
Пример #3
0
        public virtual int YorumSayısı(HaberÖğesi HaberÖğesi, int sited = 0, bool?onaylandı = null)
        {
            var sorgu = _haberYorumuDepo.Tablo.Where(comment => comment.HaberÖğesiId == HaberÖğesi.Id);

            if (sited > 0)
            {
                sorgu = sorgu.Where(comment => comment.SiteId == sited);
            }

            if (onaylandı.HasValue)
            {
                sorgu = sorgu.Where(comment => comment.Onaylandı == onaylandı.Value);
            }

            return(sorgu.Count());
        }