public IEnumerable <UstMenuModel> PageLink(string dil, string GosterimAlani) { using (Database db = new Database()) { List <UstMenuModel> menu = new List <UstMenuModel>(); string query = " SELECT I.Id as IcBaslikId, I.IcBaslik, I.Dil, I.Link, I.Target" + " FROM IcerikBaslik AS B" + " INNER JOIN Icerik AS I ON B.Id = I.BaslikId" + " WHERE B.GosterimAlani=@0 AND I.Dil=@1 AND B.Urun='0'" + " AND B.Durum='1' AND B.AnaId='0' ORDER BY B.Sira"; foreach (UstMenuModel m in db.Query <UstMenuModel>(query, GosterimAlani, dil)) { menu.Add(new UstMenuModel { IcBaslikId = m.IcBaslikId, IcBaslik = m.IcBaslik, Dil = m.Dil, Link = LinkBuldingServis.Content(m.IcBaslik, m.Link, m.Dil, m.IcBaslikId), Target = m.Target }); } return(menu); } }
public static List <UrunLinkModel> KategoriSirala(this IEnumerable <UrunLinkModel> basliklar) { siraliListe = new List <UrunLinkModel>(); toplamGelen = basliklar; anaIcerik = from p in basliklar where p.AnaId == 0 orderby p.Sira select p; foreach (UrunLinkModel p in anaIcerik) { siraliListe.Add(new UrunLinkModel { AnaId = p.AnaId, Sira = p.Sira, IcBaslikId = p.IcBaslikId, IcBaslik = p.IcBaslik, Link = LinkBuldingServis.Content(p.IcBaslik, p.Link, p.Dil, p.IcBaslikId), Dil = p.Dil, Serial = p.Serial, KatId = p.KatId }); AltKategori(p.KatId); } return(siraliListe); }