finalizare 1.0
This commit is contained in:
@@ -1,20 +1,19 @@
|
||||
using Application.Services.Database.PostgreSQL;
|
||||
using Core.Entities;
|
||||
using Infrastructure.Data;
|
||||
using Domain.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Infrastructure.Services.PostgreSQL;
|
||||
|
||||
public class PatientRepository(HealthcareManagerDatabase context)
|
||||
: BasePostgreSQLRepository<Patient>(context), IPatientRepository
|
||||
: BasePostgreSqlRepository<Patient>(context), IPatientRepository
|
||||
{
|
||||
public async Task<Patient?> FindByEmailAsync(string email)
|
||||
public async Task<Patient?> FindByEmailAsync(string email, CancellationToken token)
|
||||
{
|
||||
return await _context.Patients.FirstOrDefaultAsync(d => d.Email == email);
|
||||
return await Context.Patients.FirstOrDefaultAsync(d => d.Email == email, token);
|
||||
}
|
||||
|
||||
public async Task<bool> CredentialsMatch(string email, string password)
|
||||
public async Task<bool> CredentialsMatch(string email, string password, CancellationToken token)
|
||||
{
|
||||
return await _context.Patients.AnyAsync(u => u.Email == email && u.Password == password);
|
||||
return await Context.Patients.AnyAsync(u => u.Email == email && u.Password == password, token);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user