Files
FACULTATE-HEALTHCARE_MANAGER/backend/Infrastructure/Services/PostgreSQL/DoctorRepository.cs
T

20 lines
661 B
C#

using Application.Services.Database.PostgreSQL;
using Core.Entities;
using Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
namespace Infrastructure.Services.PostgreSQL;
public class DoctorRepository(HealthcareManagerDatabase context)
: BasePostgreSQLRepository<Doctor>(context), IDoctorRepository
{
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 await _context.Doctors.AnyAsync(u => u.Email == email && u.Password == password);
}
}