예제 #1
0
        //[ResponseType(typeof(userTest))]
        public IHttpActionResult GetTestLogs(int id)
        {
            var result = bllService.GetTestLogs(id)
                         .Select(res => new userTest
            {
                userTestID   = res.userTestID,
                userID       = res.userID,
                testID       = res.testID,
                marksScored  = res.marksScored,
                statusOfTest = res.statusOfTest,
                created_by   = res.created_by,
                modified_by  = res.modified_by,
                is_Active    = res.is_Active,
                test         = new test {
                    passingMarks = res.test.passingMarks,
                    totalMarks   = res.test.totalMarks,
                    subcategory  = new subcategory {
                        subcategoryName = res.test.subcategory.subcategoryName
                    }
                },
                testLogs = new List <testLog>
                {
                    new testLog
                    {
                        testStarted = res.testLogs.First().testStarted,
                    }
                }
            });

            if (result == null)
            {
                return(NotFound());
            }
            return(Ok(result));
        }
예제 #2
0
        public IHttpActionResult GetTestLogs(int id)
        {
            var result = bllService.GetTestLogs(id)
                         .Select(res => new userTest {
                userTestID   = res.userTestID,
                userID       = res.userID,
                testID       = res.testID,
                marksScored  = res.marksScored,
                statusOfTest = res.statusOfTest,
                created_by   = res.created_by,
                modified_by  = res.modified_by,
                is_Active    = res.is_Active,
                test         = new test {
                    subcategory = new subcategory {
                        subcategoryName = res.test.subcategory.subcategoryName
                    }
                }
            });

            if (result == null)
            {
                return(NotFound());
            }
            return(Ok(result));
        }