api v2.0
This commit is contained in:
@@ -5,8 +5,16 @@ using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Infrastructure.Services.PostgreSQL;
|
||||
|
||||
public class DoctorRepository(HealthcareManagerDatabase context) : BasePostgreSQLRepository<Doctor>(context), IDoctorRepository
|
||||
public class DoctorRepository(HealthcareManagerDatabase context)
|
||||
: BasePostgreSQLRepository<Doctor>(context), IDoctorRepository
|
||||
{
|
||||
public async Task<Doctor?> FindByEmailAsync(string email)
|
||||
=> await _context.Doctors.FirstOrDefaultAsync(d => d.Email == email);
|
||||
}
|
||||
public async Task<Doctor?> FindByEmailAsync(string email)
|
||||
{
|
||||
return await _context.Doctors.FirstOrDefaultAsync(d => d.Email == email);
|
||||
}
|
||||
|
||||
public async Task<bool> CredentialsMatch(string email, string password)
|
||||
{
|
||||
return _context.Doctors.Any(u => u.Email == email && u.Password == password);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user