I created this function and I am not sure that it is the best way to create an asynchronous function that gets data from entity framework:
public async Task<Employe?> EmployeToConnect(string login, string password)
{
Employe? employeResult = null;
employeResult = await _context.Employes.FirstOrDefaultAsync
(empl => empl.Login == login && empl.Password == password);
return employeResult;
}
Is there a better way to do it? (Seeing that the inspected returned type is Task< Employe> and we just returned Employe? )