public KeyValuePair <string, string> GetQuestionAnswer() { using (var context = new MVCDBEntities()) { Random rand = new Random(); int toSkip = rand.Next(0, context.QnAs.Count <QnA>()); var myQnA = context.QnAs.OrderBy(q => q.QnAId).Skip(toSkip).Take(1).First(); var question = myQnA.Question; var answer = myQnA.Answer; return(new KeyValuePair <string, string>(question, answer)); } }
public AuthorRepository(MVCDBEntities AuthorContext) { _Context = AuthorContext; }
public BookRepository(MVCDBEntities bookContext) { this._context = bookContext; }