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,35 +1,159 @@
|
|||
using BMA.EHR.Application.Common.Interfaces;
|
||||
using BMA.EHR.Domain.Entities.MetaData.BloodGroup;
|
||||
using BMA.EHR.Domain.Entities.MetaData.Prefix;
|
||||
using BMA.EHR.Domain.Models.MetaData;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Persistence
|
||||
{
|
||||
public class ApplicationDBContext : DbContext, IApplicationDBContext
|
||||
{
|
||||
#region " From Existing Database "
|
||||
|
||||
#region " Meta Data "
|
||||
|
||||
public DbSet<Prefix> Prefixes { get; set; }
|
||||
|
||||
public DbSet<BloodGroup> BloodGroups { get; set; }
|
||||
|
||||
public DbSet<Gender> Genders { get; set; }
|
||||
|
||||
public DbSet<PhysicalStatus> PhysicalStatuses { get; set; }
|
||||
|
||||
public DbSet<Religion> Religions { get; set; }
|
||||
|
||||
public DbSet<EducationLevel> EducationLevels { get; set; }
|
||||
|
||||
public DbSet<PositionPath> PositionPaths { get; set; }
|
||||
|
||||
public DbSet<PositionType> PositionTypes { get; set; }
|
||||
|
||||
public DbSet<PositionEmployeePosition> PositionEmployeePositions { get; set; }
|
||||
|
||||
public DbSet<PositionEmployeePositionSide> PositionEmployeePositionSides { get; set; }
|
||||
|
||||
public DbSet<PositionEmployeeGroup> PositionEmployeeGroups { get; set; }
|
||||
|
||||
public DbSet<PositionEmployeeLine> PositionEmployeeLines { get; set; }
|
||||
|
||||
public DbSet<PositionEmployeeLevel> PositionEmployeeLevels { get; set; }
|
||||
|
||||
public DbSet<PositionEmployeeStatus> PositionEmployeeStatuses { get; set; }
|
||||
|
||||
public DbSet<PositionLine> PositionLines { get; set; }
|
||||
|
||||
public DbSet<PositionExecutive> PositionExecutives { get; set; }
|
||||
|
||||
public DbSet<PositionStatus> PositionStatuss { get; set; }
|
||||
|
||||
public DbSet<PositionLevel> PositionLevels { get; set; }
|
||||
|
||||
public DbSet<Relationship> Relationships { get; set; }
|
||||
|
||||
public DbSet<Position> Positions { get; set; }
|
||||
|
||||
public DbSet<PositionPathSide> PositionPathSides { get; set; }
|
||||
|
||||
public DbSet<PositionExecutiveSide> PositionExecutiveSides { get; set; }
|
||||
|
||||
public DbSet<InsigniaType> InsigniaTypes { get; set; }
|
||||
|
||||
public DbSet<Insignia> Insignias { get; set; }
|
||||
|
||||
public DbSet<Province> Provinces { get; set; }
|
||||
|
||||
public DbSet<District> Districts { get; set; }
|
||||
|
||||
public DbSet<SubDistrict> SubDistricts { get; set; }
|
||||
|
||||
public DbSet<Holiday> Holidays { get; set; }
|
||||
|
||||
public DbSet<OrganizationType> OrganizationTypes { get; set; }
|
||||
|
||||
public DbSet<OrganizationLevel> OrganizationLevels { get; set; }
|
||||
|
||||
public DbSet<OrganizationOrganization> OrganizationOrganizations { get; set; }
|
||||
|
||||
public DbSet<OrganizationShortName> OrganizationShortNames { get; set; }
|
||||
|
||||
public DbSet<OrganizationStatus> OrganizationStatuses { get; set; }
|
||||
|
||||
public DbSet<OrganizationAgency> OrganizationAgencys { get; set; }
|
||||
|
||||
public DbSet<OrganizationGovernmentAgency> OrganizationGovernmentAgencys { get; set; }
|
||||
|
||||
public DbSet<OrganizationTelExternal> OrganizationTelExternals { get; set; }
|
||||
|
||||
public DbSet<OrganizationTelInternal> OrganizationTelInternals { get; set; }
|
||||
|
||||
public DbSet<OrganizationFax> OrganizationFaxs { get; set; }
|
||||
|
||||
public DbSet<RoyalHierarchy> RoyalHierarchys { get; set; }
|
||||
|
||||
public DbSet<RoyalType> RoyalTypes { get; set; }
|
||||
|
||||
public DbSet<Royal> Royals { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
public ApplicationDBContext(DbContextOptions<ApplicationDBContext> options) : base(options)
|
||||
{
|
||||
}
|
||||
|
||||
#region " Prefix "
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
|
||||
|
||||
public DbSet<PrefixEntity> MD_Prefixes { get; set; }
|
||||
//Ignore Existing table from other service
|
||||
//modelBuilder.Ignore<Prefix>();
|
||||
//modelBuilder.Ignore<BloodGroup>();
|
||||
//modelBuilder.Ignore<Gender>();
|
||||
//modelBuilder.Ignore<PhysicalStatus>();
|
||||
//modelBuilder.Ignore<Religion>();
|
||||
//modelBuilder.Ignore<EducationLevel>();
|
||||
//modelBuilder.Ignore<PositionPath>();
|
||||
//modelBuilder.Ignore<PositionType>();
|
||||
//modelBuilder.Ignore<PositionEmployeePosition>();
|
||||
//modelBuilder.Ignore<PositionEmployeePositionSide>();
|
||||
//modelBuilder.Ignore<PositionEmployeeGroup>();
|
||||
//modelBuilder.Ignore<PositionEmployeeLine>();
|
||||
//modelBuilder.Ignore<PositionEmployeeLevel>();
|
||||
//modelBuilder.Ignore<PositionEmployeeStatus>();
|
||||
//modelBuilder.Ignore<PositionLine>();
|
||||
//modelBuilder.Ignore<PositionExecutive>();
|
||||
//modelBuilder.Ignore<PositionStatus>();
|
||||
//modelBuilder.Ignore<PositionLevel>();
|
||||
//modelBuilder.Ignore<Relationship>();
|
||||
//modelBuilder.Ignore<Position>();
|
||||
//modelBuilder.Ignore<PositionPathSide>();
|
||||
//modelBuilder.Ignore<PositionExecutiveSide>();
|
||||
//modelBuilder.Ignore<InsigniaType>();
|
||||
//modelBuilder.Ignore<Insignia>();
|
||||
//modelBuilder.Ignore<Province>();
|
||||
//modelBuilder.Ignore<District>();
|
||||
//modelBuilder.Ignore<SubDistrict>();
|
||||
//modelBuilder.Ignore<Holiday>();
|
||||
//modelBuilder.Ignore<OrganizationType>();
|
||||
//modelBuilder.Ignore<OrganizationLevel>();
|
||||
//modelBuilder.Ignore<OrganizationOrganization>();
|
||||
//modelBuilder.Ignore<OrganizationShortName>();
|
||||
//modelBuilder.Ignore<OrganizationStatus>();
|
||||
//modelBuilder.Ignore<OrganizationAgency>();
|
||||
//modelBuilder.Ignore<OrganizationGovernmentAgency>();
|
||||
//modelBuilder.Ignore<OrganizationTelExternal>();
|
||||
//modelBuilder.Ignore<OrganizationTelInternal>();
|
||||
//modelBuilder.Ignore<OrganizationFax>();
|
||||
//modelBuilder.Ignore<RoyalHierarchy>();
|
||||
//modelBuilder.Ignore<RoyalType>();
|
||||
//modelBuilder.Ignore<Royal>();
|
||||
|
||||
public DbSet<PrefixDraftEntity> MD_Prefix_Drafts { get; set; }
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
|
||||
public DbSet<PrefixPublishHistoryEntity> MD_Prefix_Histories { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region " BloodGroups "
|
||||
|
||||
public DbSet<BloodGroupEntity> MD_BloodGroups { get; set; }
|
||||
|
||||
public DbSet<BloodGroupDraftEntity> MD_BloodGroup_Drafts { get; set; }
|
||||
|
||||
public DbSet<BloodGroupPublishHistoryEntity> MD_BloodGroup_Histories { get; set; }
|
||||
|
||||
#endregion
|
||||
public override DbSet<TEntity> Set<TEntity>() where TEntity : class
|
||||
{
|
||||
return base.Set<TEntity>();
|
||||
}
|
||||
|
||||
public Task<int> SaveChangesAsync()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue