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 DoctorRepository(HealthcareManagerDatabase context)
: BasePostgreSQLRepository<Doctor>(context), IDoctorRepository
: BasePostgreSqlRepository<Doctor>(context), IDoctorRepository
{
public async Task<Doctor?> FindByEmailAsync(string email)
public async Task<Doctor?> FindByEmailAsync(string email, CancellationToken token)
{
return await _context.Doctors.FirstOrDefaultAsync(d => d.Email == email);
return await Context.Doctors.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.Doctors.AnyAsync(u => u.Email == email && u.Password == password);
return await Context.Doctors.AnyAsync(u => u.Email == email && u.Password == password, token);
}
}