public static bool SecurityQuestionAnsweredCorrect(string username, string answer) { TravelExpertsContext context = new TravelExpertsContext(); CustomersAuthentication target = context.CustomersAuthentications.SingleOrDefault(c => c.Username == username); if (target.SQAnswer1 == answer) { return(true); } else { return(false); } }
public static string GetSecurityQuestion(string username) { TravelExpertsContext context = new TravelExpertsContext(); CustomersAuthentication target = context.CustomersAuthentications.SingleOrDefault(c => c.Username == username); string question; if (target == null) { question = null; } else { question = target.SecurityQuestion1; } return(question); }