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