Files
FACULTATE-HEALTHCARE_MANAGER/backend/Infrastructure/Services/PostgreSQL/MedicalHistoryRepository.cs
T
2024-04-08 00:03:24 +03:00

18 lines
558 B
C#

using Application.Services.Database;
using Core.Entities;
using Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
namespace Infrastructure.Services.PostgreSQL;
public class MedicalHistoryRepository : BasePostgreSQLRepository<MedicalHistory>, IMedicalHistoryRepository
{
public MedicalHistoryRepository(HealthcareManagerDatabase context) : base(context)
{
}
public async Task<MedicalHistory?> GetByUserIdAsync(Guid userId)
{
return await _context.MedicalHistories.FirstOrDefaultAsync(d => d.UserId == userId);
}
}