public void UpdateQuestionsCategory(QuestionsCategory category) { using (var _context = new AskUsDbContext()) { _context.Entry(category).State = System.Data.Entity.EntityState.Modified; _context.SaveChanges(); } }
public void UpdateAnswerReview(AnswerReview answerReview) { using (var _context = new AskUsDbContext()) { _context.Entry(answerReview).State = EntityState.Modified; _context.SaveChanges(); } }
public void UpdateUserRole(UserRole userRole) { using (var _context = new AskUsDbContext()) { _context.Entry(userRole).State = System.Data.Entity.EntityState.Modified; _context.SaveChanges(); } }
public void UpdateServiceLocation(ServiceLocation serviceLocation) { using (var _context = new AskUsDbContext()) { _context.Entry(serviceLocation).State = System.Data.Entity.EntityState.Modified; _context.SaveChanges(); } }
public void UpdateQuestion(Question question) { using (var _context = new AskUsDbContext()) { _context.Entry(question).State = EntityState.Modified; _context.SaveChanges(); } }
public void UpdateQuestionAnswer(QuestionAnswer questionAnswer) { using (var _context = new AskUsDbContext()) { _context.Entry(questionAnswer).State = System.Data.Entity.EntityState.Modified; _context.SaveChanges(); } }
/// <summary> /// Method to validate token against expiry and existence in database. /// </summary> /// <param name="tokenId"></param> /// <returns></returns> public bool ValidateToken(string tokenId) { using (var _context = new AskUsDbContext()) { var token = _context.Tokens.Where(t => t.AuthToken == tokenId && t.ExpiresOn > DateTime.Now).FirstOrDefault(); if (token != null && !(DateTime.Now > token.ExpiresOn)) { token.ExpiresOn = token.ExpiresOn.AddSeconds(3000);//(Convert.ToDouble(ConfigurationManager.AppSettings["AuthTokenExpiry"])); _context.Entry(token).State = System.Data.Entity.EntityState.Modified; _context.SaveChanges(); return(true); } return(false); } }