/// <summary> /// Method to ad a review to db context /// </summary> /// <param name="review">review</param> public void AddReview(Review review) { using (var lineageContext = new LineageContext("LineageContext")) { lineageContext.Reviews.Add(review); lineageContext.SaveChanges(); } }
/// <summary> /// Method to get all reviews from db context /// </summary> /// <returns>List of reviews</returns> public List <Review> GetAllReviews() { using (var lineageContext = new LineageContext("LineageContext")) { var datalist = lineageContext.Reviews.ToList(); return(datalist); } }
/// <summary> /// Method to add an article to the db context /// </summary> /// <param name="article">article</param> public void AddArticle(Article article) { using (var lineageContext = new LineageContext("LineageContext")) { lineageContext.Articles.Add(article); lineageContext.SaveChanges(); } }
/// <summary> /// Method to get all article from db context /// </summary> /// <returns>list of articles</returns> public List <Article> GetAllArticles() { using (var lineageContext = new LineageContext("LineageContext")) { var datalist = lineageContext.Articles.ToList(); return(datalist); } }
/// <summary> /// Method to ad a survey to db context /// </summary> /// <param name="survey">survey</param> public void AddSurvey(Survey survey) { using (var lineageContext = new LineageContext("LineageContext")) { lineageContext.Surveys.Add(survey); lineageContext.SaveChanges(); } }
/// <summary> /// Method to get all surveys from db context /// </summary> /// <returns>list of surveys</returns> public List <Survey> GetAllSurveys() { using (var lineageContext = new LineageContext("LineageContext")) { var datalist = lineageContext.Surveys.ToList(); return(datalist); } }