Add project files.
This commit is contained in:
parent
cc6b248537
commit
717b0f0a8e
31 changed files with 1296 additions and 0 deletions
26
BMA.EHR.Application/Repositories/BloodGroupRepository.cs
Normal file
26
BMA.EHR.Application/Repositories/BloodGroupRepository.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
using BMA.EHR.Application.Common.Interfaces;
|
||||
using BMA.EHR.Domain.Entities.MetaData;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Application.Repositories
|
||||
{
|
||||
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.BloodGroups.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<BloodGroupEntity?> GetByIdAsync(Guid id)
|
||||
{
|
||||
return await _dbContext.BloodGroups.FirstOrDefaultAsync(x => x.Id == id);
|
||||
}
|
||||
}
|
||||
}
|
||||
26
BMA.EHR.Application/Repositories/PrefixRepository.cs
Normal file
26
BMA.EHR.Application/Repositories/PrefixRepository.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
using BMA.EHR.Application.Common.Interfaces;
|
||||
using BMA.EHR.Domain.Entities.MetaData;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Application.Repositories
|
||||
{
|
||||
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.Prefixes.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<PrefixEntity?> GetByIdAsync(Guid id)
|
||||
{
|
||||
return await _dbContext.Prefixes.FirstOrDefaultAsync(x => x.Id == id);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue