public async Task <IActionResult> Authenticate(Credential cred) { Debug.Write("inside authenticate...cred is: " + cred.ToString()); var user = await _credentialRepository.Authenticate(cred.CredentialId, cred.Password); if (user == null) { return(BadRequest("Username or password is incorrect")); } Employee emp = await _employeeRepository.Get(user.EmployeeId); return(Ok(new AuthenticateReturn(user, emp))); }