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

20 lines
667 B
C#

using Application.Services.Database.PostgreSQL;
using Core.Entities;
using Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
namespace Infrastructure.Services.PostgreSQL;
public class PatientRepository(HealthcareManagerDatabase context)
: BasePostgreSQLRepository<Patient>(context), IPatientRepository
{
public async Task<Patient?> FindByEmailAsync(string email)
{
return await _context.Patients.FirstOrDefaultAsync(d => d.Email == email);
}
public async Task<bool> CredentialsMatch(string email, string password)
{
return await _context.Patients.AnyAsync(u => u.Email == email && u.Password == password);
}
}