示例#1
0
 public IEnumerable <FAQ> GetFAQsFromSubKategoriId(int id)
 {
     using (var db = new NorWayContext())
     {
         try
         {
             return(db.FAQ.Where(f => f.SubKategoriId == id).OrderByDescending(r => r.Rating).ToList());
         }
         catch
         {
             throw;
         }
     }
 }
示例#2
0
 public int AddFAQInn(FAQInn FAQInn)
 {
     using (var db = new NorWayContext())
     {
         try
         {
             db.FAQInn.Add(FAQInn);
             db.SaveChanges();
             return(1);
         }
         catch
         {
             throw;
         }
     }
 }
示例#3
0
 public bool UpdateFAQRating(int faqId, int rating)
 {
     using (var db = new NorWayContext())
     {
         try
         {
             var faq = db.FAQ.Find(faqId);
             faq.Rating = rating;
             db.SaveChanges();
             return(true);
         }
         catch
         {
             return(false);
         }
     }
 }