Restructure TAble

This commit is contained in:
Suphonchai Phoonsawat 2023-06-25 18:36:02 +07:00
parent 717b0f0a8e
commit 1ba2f2eec1
37 changed files with 1107 additions and 527 deletions

View file

@ -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);
}
}
}

View file

@ -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);
}
}
}

View 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);
}
}
}

View file

@ -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);
}
}
}