Files
FACULTATE-HEALTHCARE_MANAGER/backend/Infrastructure/Services/PostgreSQL/DoctorRepository.cs
T
2024-05-21 12:10:53 +03:00

19 lines
698 B
C#

using Application.Services.Database.PostgreSQL;
using Domain.Entities;
using Microsoft.EntityFrameworkCore;
namespace Infrastructure.Services.PostgreSQL;
public class DoctorRepository(HealthcareManagerDatabase context)
: BasePostgreSqlRepository<Doctor>(context), IDoctorRepository
{
public async Task<Doctor?> FindByEmailAsync(string email, CancellationToken token)
{
return await Context.Doctors.FirstOrDefaultAsync(d => d.Email == email, token);
}
public async Task<bool> CredentialsMatch(string email, string password, CancellationToken token)
{
return await Context.Doctors.AnyAsync(u => u.Email == email && u.Password == password, token);
}
}