public async Task <IActionResult> Create([FromBody] StudentAuth oUser)
        {
            try
            {
                Student student = await _studentService.authenticateStudent(oUser);

                return(new OkObjectResult(student));
            }
            catch (Exception ex)
            {
                return(StatusCode(500, "Internal server error" + ex.Message));
            }
        }
Beispiel #2
0
        public async Task <Student> authenticateStudent(StudentAuth auth)
        {
            Student student = await _studentRepository.Collection.Find(x => x.password == auth.password && x.email == auth.emailId).SingleOrDefaultAsync();

            return(student);
        }