finalizare 1.0

This commit is contained in:
andrei-mihnea-cerbu
2024-05-21 12:10:53 +03:00
parent f7795f7519
commit 1cc1d34003
11268 changed files with 2102399 additions and 10909 deletions
@@ -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);
}
}