Пример #1
0
 //
 // GET: /Pitanja/
 public ActionResult Index()
 {
     List<DBBL.DAL.Pitanja> pitanja;
     using (Pitanja pt= new Pitanja())
     {
         pitanja= pt.GetAllPitanja();
     }
     return View(pitanja);
 }
 public static List<LuceneObject> GetAllPitanja()
 {
     List<DBBL.DAL.Pitanja> pitanja;
     using (Pitanja pt = new Pitanja())
     {
         pitanja = pt.GetAllPitanja();
     }
     List<LuceneObject> lstPitanjeLucne = new List<LuceneObject>();
     foreach (var item in pitanja)
     {
         LuceneObject pt = new LuceneObject();
         pt.Id = item.PitanjeID;
         pt.Name = item.Naziv;
         pt.Description = item.Opis;
         pt.IsQuestion = true;
         lstPitanjeLucne.Add(pt);
     }
     return lstPitanjeLucne;
 }