Add MetaData Table From ExistData
Change to use MySQL
This commit is contained in:
parent
89de09d213
commit
a0b3b13074
136 changed files with 3438 additions and 1237 deletions
|
|
@ -1,28 +0,0 @@
|
|||
using BMA.EHR.Application.Common.Interfaces;
|
||||
using BMA.EHR.Domain.Entities.MetaData.BloodGroup;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace BMA.EHR.Application.Repositories.BloodGroup
|
||||
{
|
||||
public class BloodGroupRepository : GenericRepository<Guid, BloodGroupEntity>
|
||||
{
|
||||
#region " Fields "
|
||||
|
||||
private readonly IApplicationDBContext _dbContext;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
|
||||
#endregion
|
||||
|
||||
#region " Constructor and Destructor "
|
||||
|
||||
public BloodGroupRepository(IApplicationDBContext dbContext,
|
||||
IHttpContextAccessor httpContextAccessor) : base(dbContext, httpContextAccessor)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -29,9 +29,9 @@ namespace BMA.EHR.Application.Repositories
|
|||
|
||||
#region " Properties "
|
||||
|
||||
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
|
||||
protected string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
|
||||
|
||||
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
||||
protected string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
@ -47,6 +47,43 @@ namespace BMA.EHR.Application.Repositories
|
|||
return await _dbSet.FindAsync(id);
|
||||
}
|
||||
|
||||
public async Task<T> AddAsync(T entity)
|
||||
{
|
||||
//if (entity is IAuditableEntity)
|
||||
//{
|
||||
// (entity as IAuditableEntity).CreatedUserId = Guid.Parse(UserId);
|
||||
// (entity as IAuditableEntity).CreatedUserFullName = FullName;
|
||||
// (entity as IAuditableEntity).CreatedDate = DateTime.Now;
|
||||
//}
|
||||
|
||||
|
||||
await _dbSet.AddAsync(entity);
|
||||
await _dbContext.SaveChangesAsync();
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public async Task<T> UpdateAsync(T entity)
|
||||
{
|
||||
//if (entity is IAuditableEntity)
|
||||
//{
|
||||
// (entity as IAuditableEntity).ModifiedUserId = Guid.Parse(UserId);
|
||||
// (entity as IAuditableEntity).ModifiedUserFullName = FullName;
|
||||
// (entity as IAuditableEntity).ModifiedDate = DateTime.Now;
|
||||
//}
|
||||
|
||||
_dbSet.Update(entity);
|
||||
await _dbContext.SaveChangesAsync();
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(T entity)
|
||||
{
|
||||
_dbSet.Remove(entity);
|
||||
await _dbContext.SaveChangesAsync();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,28 +1,18 @@
|
|||
using BMA.EHR.Application.Common.Interfaces;
|
||||
using BMA.EHR.Domain.Entities.MetaData.Prefix;
|
||||
using BMA.EHR.Domain.Models.MetaData;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System.Security.AccessControl;
|
||||
|
||||
namespace BMA.EHR.Application.Repositories.Prefix
|
||||
namespace BMA.EHR.Application.Repositories
|
||||
{
|
||||
public class PrefixRepository : GenericRepository<Guid, PrefixEntity>
|
||||
public class PrefixRepository : GenericRepository<Guid, Prefix>
|
||||
{
|
||||
#region " Fields "
|
||||
|
||||
private readonly IApplicationDBContext _dbContext;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
|
||||
#endregion
|
||||
|
||||
#region " Constructor and Destructor "
|
||||
|
||||
public PrefixRepository(IApplicationDBContext dbContext,
|
||||
IHttpContextAccessor httpContextAccessor) : base(dbContext, httpContextAccessor)
|
||||
public PrefixRepository(IApplicationDBContext dbContext, IHttpContextAccessor httpContextAccessor) : base(dbContext, httpContextAccessor)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue