Restructure TAble
This commit is contained in:
parent
717b0f0a8e
commit
1ba2f2eec1
37 changed files with 1107 additions and 527 deletions
|
|
@ -0,0 +1,26 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
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/Prefix/PrefixRepository.cs
Normal file
26
BMA.EHR.Application/Repositories/Prefix/PrefixRepository.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
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