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