public List <Twit> tumTwitleriCek(int uyeID) { List <Twit> twitler = new List <Twit>(); foreach (tblUyeTakip i in t.tblUyeTakip.Where(x => x.takipEdenID == uyeID)) { foreach (tblTwit j in t.tblTwit.Where(x => x.uyeID == i.takipEdilenID)) { Twit t1 = new Twit(); t1.twitID = j.twitID; t1.icerik = j.icerik; t1.atilmaTarihi = j.atilmaTarihi.Value.ToString(); t1.kAdi = j.tblUye.kullaniciAdi; twitler.Add(t1); } } return(twitler.OrderByDescending(x => x.twitID).ToList()); }
public Twit TwitAt(string icerik, int uyeID) { tblTwit twit = new tblTwit(); twit.icerik = icerik; twit.uyeID = uyeID; twit.atilmaTarihi = DateTime.Now; t.tblTwit.Add(twit); t.SaveChanges(); Twit tw = new Twit(); tw.kAdi = t.tblUye.FirstOrDefault(x => x.uyeID == uyeID).kullaniciAdi; tw.icerik = twit.icerik; return(tw); }