API Traieste
This commit is contained in:
@@ -5,9 +5,9 @@ namespace Infrastructure.Services.PostgreSQL
|
||||
{
|
||||
public class BasePostgreSQLRepository<T> where T : class
|
||||
{
|
||||
protected readonly HealthcareManagerContext _context;
|
||||
protected readonly HealthcareManagerDatabase _context;
|
||||
|
||||
public BasePostgreSQLRepository(HealthcareManagerContext context)
|
||||
public BasePostgreSQLRepository(HealthcareManagerDatabase context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
using Application.Contracts.Database;
|
||||
using Application.Services.Database;
|
||||
using Core.Entities;
|
||||
using Infrastructure.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Infrastructure.Services.PostgreSQL
|
||||
{
|
||||
public class DoctorRepository : BasePostgreSQLRepository<Doctor>, IDoctorRepository
|
||||
{
|
||||
public DoctorRepository(HealthcareManagerContext context) : base(context)
|
||||
public DoctorRepository(HealthcareManagerDatabase context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<bool> IsDoctorExisting(string email)
|
||||
{
|
||||
return await _context.Doctors.AnyAsync(d => d.Email == email);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Application.Contracts.Database;
|
||||
using Application.Services.Database;
|
||||
using Core.Entities;
|
||||
using Infrastructure.Data;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Infrastructure.Services.PostgreSQL
|
||||
{
|
||||
public class MedicalHistoryRepository : BasePostgreSQLRepository<MedicalHistory>, IMedicalHistoryRepository
|
||||
{
|
||||
public MedicalHistoryRepository(HealthcareManagerContext context) : base(context)
|
||||
public MedicalHistoryRepository(HealthcareManagerDatabase context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Application.Contracts.Database;
|
||||
using Application.Services.Database;
|
||||
using Core.Entities;
|
||||
using Infrastructure.Data;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Infrastructure.Services.PostgreSQL
|
||||
{
|
||||
public class PacientRepository : BasePostgreSQLRepository<Pacient>, IPacientRepository
|
||||
{
|
||||
public PacientRepository(HealthcareManagerContext context) : base(context)
|
||||
public PacientRepository(HealthcareManagerDatabase context) : base(context)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user