Пример #1
0
 public IHttpActionResult LoginUser([FromBody] Student loginStudent)
 {
     try
     {
         Student s = StudentsDB.LoginUser(loginStudent.Email, loginStudent.Password);
         if (s != null)
         {
             return(Ok(s));
         }
         else
         {
             return(Content(HttpStatusCode.NotFound, $"student with email={loginStudent.Email} and pass={loginStudent.Password} was not found for login!"));
         }
     }
     catch (Exception ex)
     {
         return(Content(HttpStatusCode.InternalServerError, ex));
     }
 }