26 lines
812 B
C#
26 lines
812 B
C#
using BMA.EHR.Application.Common.Interfaces;
|
|
using BMA.EHR.Domain.Entities.MetaData.BloodGroup;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace BMA.EHR.Application.Repositories.BloodGroup
|
|
{
|
|
public class BloodGroupRepository : IGenericRepository<Guid, BloodGroupEntity>
|
|
{
|
|
private readonly IApplicationDBContext _dbContext;
|
|
|
|
public BloodGroupRepository(IApplicationDBContext dbContext)
|
|
{
|
|
_dbContext = dbContext;
|
|
}
|
|
|
|
public async Task<IReadOnlyList<BloodGroupEntity>> GetAllAsync()
|
|
{
|
|
return await _dbContext.MD_BloodGroups.ToListAsync();
|
|
}
|
|
|
|
public async Task<BloodGroupEntity?> GetByIdAsync(Guid id)
|
|
{
|
|
return await _dbContext.MD_BloodGroups.FirstOrDefaultAsync(x => x.Id == id);
|
|
}
|
|
}
|
|
}
|