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; } } }
public int AddFAQInn(FAQInn FAQInn) { using (var db = new NorWayContext()) { try { db.FAQInn.Add(FAQInn); db.SaveChanges(); return(1); } catch { throw; } } }
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); } } }