コード例 #1
0
        public static IEnumerable <Result> GetAllResults(CBTWebAPIContext db)
        {
            var answers = db.Users.ToList();


            return(answers.Where(x => x.QuestionAndAnswers.Any()).Select(m => new Result {
                Email = m.Email, FullName = m.FullName, PhoneNumber = m.PhoneNumber, Centre = m.Centre, CorrectANswers = m.QuestionAndAnswers.Where(x => x.Answer == x.CorrectAnswer).Count()
            }));
        }
コード例 #2
0
        public static IEnumerable <User> GetAllUsers()
        {
            var db = new CBTWebAPIContext();

            return(db.Users);
        }