消防培训系统服务器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

321 lines
12 KiB

using AX.FireTrainingSys.EntityConfigurations;
using AX.FireTrainingSys.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace AX.FireTrainingSys
{
/// <summary>
/// 灭火救援指挥培训系统数据库上下文。
/// </summary>
public class DriveDbContext : DbContext
{
#region 公用部分
/// <summary>
/// 用户。
/// </summary>
public DbSet<User> Users { get; set; }
/// <summary>
/// 职务。
/// </summary>
public DbSet<Post> Posts { get; set; }
/// <summary>
/// 学习记录。
/// </summary>
public DbSet<StudyRecord> StudyRecords { get; set; }
#endregion
#region 指挥员战术战法培训子系统 - 模板基本信息
/// <summary>
/// 基本信息。
/// </summary>
public DbSet<TemplateBuildingBasicInfo> TemplateBuildingBasicInfos { get; set; }
/// <summary>
/// 建筑特点。
/// </summary>
public DbSet<TemplateBuildingFeature> TemplateBuildingFeatures { get; set; }
/// <summary>
/// 毗邻。
/// </summary>
public DbSet<TemplateBuildingAdjoin> TemplateBuildingAdjoins { get; set; }
/// <summary>
/// 图片标记。
/// </summary>
public DbSet<TemplateImageMarker> TemplateImageMarkers { get; set; }
/// <summary>
/// 禁停区。
/// </summary>
public DbSet<TemplateNoParkingArea> TemplateNoParkingAreas { get; set; }
/// <summary>
/// 重点部位/重点提示。
/// </summary>
public DbSet<TemplateImportantLocation> TemplateImportantLocations { get; set; }
/// <summary>
/// 消防控制室。
/// </summary>
public DbSet<TemplateFireControlRoom> TemplateFireControlRooms { get; set; }
/// <summary>
/// 安全出口。
/// </summary>
public DbSet<TemplateExit> TemplateExits { get; set; }
/// <summary>
/// 疏散楼梯。
/// </summary>
public DbSet<TemplateProtectedStairway> TemplateProtectedStairways { get; set; }
/// <summary>
/// 消防电梯。
/// </summary>
public DbSet<TemplateFireLift> TemplateFireLifts { get; set; }
/// <summary>
/// 泵房/水箱。
/// </summary>
public DbSet<TemplatePumpRoom> TemplatePumpRooms { get; set; }
/// <summary>
/// 水泵接合器。
/// </summary>
public DbSet<TemplateSiameseConnection> TemplateSiameseConnections { get; set; }
/// <summary>
/// 室外消火栓。
/// </summary>
public DbSet<TemplateOutdoorFireHydrant> TemplateOutdoorFireHydrants { get; set; }
/// <summary>
/// 市政消火栓。
/// </summary>
public DbSet<TemplateMunicipalFireHydrant> TemplateMunicipalFireHydrants { get; set; }
/// <summary>
/// 周边水源。
/// </summary>
public DbSet<TemplatePeripheralWaterSource> TemplatePeripheralWaterSources { get; set; }
/// <summary>
/// 行车路线。
/// </summary>
public DbSet<TemplateDriveRoute> TemplateDriveRoutes { get; set; }
/// <summary>
/// 储罐。
/// </summary>
public DbSet<TemplateStorageTank> TemplateStorageTanks { get; set; }
/// <summary>
/// 泡沫泵房。
/// </summary>
public DbSet<TemplateFoamPumpRoom> TemplateFoamPumpRooms { get; set; }
/// <summary>
/// 水罐。
/// </summary>
public DbSet<TemplateWaterTank> TemplateWaterTanks { get; set; }
/// <summary>
/// 消防水炮。
/// </summary>
public DbSet<TemplateFireWaterMonitor> TemplateFireWaterMonitors { get; set; }
/// <summary>
/// 泡沫栓。
/// </summary>
public DbSet<TemplateFoamHydrant> TemplateFoamHydrants { get; set; }
/// <summary>
/// 组织机构。
/// </summary>
public DbSet<TemplateOrganization> TemplateOrganizations { get; set; }
/// <summary>
/// 消防力量。
/// </summary>
public DbSet<TemplateFireForce> TemplateFireForces { get; set; }
#endregion
#region 指挥员战术战法培训子系统 - 基本信息
/// <summary>
/// 基本信息。
/// </summary>
public DbSet<BuildingBasicInfo> BuildingBasicInfos { get; set; }
/// <summary>
/// 建筑特点。
/// </summary>
public DbSet<BuildingFeature> BuildingFeatures { get; set; }
/// <summary>
/// 毗邻。
/// </summary>
public DbSet<BuildingAdjoin> BuildingAdjoins { get; set; }
/// <summary>
/// 图片标记。
/// </summary>
public DbSet<ImageMarker> ImageMarkers { get; set; }
/// <summary>
/// 禁停区。
/// </summary>
public DbSet<NoParkingArea> NoParkingAreas { get; set; }
/// <summary>
/// 重点部位/重点提示。
/// </summary>
public DbSet<ImportantLocation> ImportantLocations { get; set; }
/// <summary>
/// 消防控制室。
/// </summary>
public DbSet<FireControlRoom> FireControlRooms { get; set; }
/// <summary>
/// 安全出口。
/// </summary>
public DbSet<Exit> Exits { get; set; }
/// <summary>
/// 疏散楼梯。
/// </summary>
public DbSet<ProtectedStairway> ProtectedStairways { get; set; }
/// <summary>
/// 消防电梯。
/// </summary>
public DbSet<FireLift> FireLifts { get; set; }
/// <summary>
/// 泵房/水箱。
/// </summary>
public DbSet<PumpRoom> PumpRooms { get; set; }
/// <summary>
/// 水泵接合器。
/// </summary>
public DbSet<SiameseConnection> SiameseConnections { get; set; }
/// <summary>
/// 室外消火栓。
/// </summary>
public DbSet<OutdoorFireHydrant> OutdoorFireHydrants { get; set; }
/// <summary>
/// 市政消火栓。
/// </summary>
public DbSet<MunicipalFireHydrant> MunicipalFireHydrants { get; set; }
/// <summary>
/// 周边水源。
/// </summary>
public DbSet<PeripheralWaterSource> PeripheralWaterSources { get; set; }
/// <summary>
/// 行车路线。
/// </summary>
public DbSet<DriveRoute> DriveRoutes { get; set; }
/// <summary>
/// 储罐。
/// </summary>
public DbSet<StorageTank> StorageTanks { get; set; }
/// <summary>
/// 泡沫泵房。
/// </summary>
public DbSet<FoamPumpRoom> FoamPumpRooms { get; set; }
/// <summary>
/// 水罐。
/// </summary>
public DbSet<WaterTank> WaterTanks { get; set; }
/// <summary>
/// 消防水炮。
/// </summary>
public DbSet<FireWaterMonitor> FireWaterMonitors { get; set; }
/// <summary>
/// 泡沫栓。
/// </summary>
public DbSet<FoamHydrant> FoamHydrants { get; set; }
/// <summary>
/// 组织机构。
/// </summary>
public DbSet<Organization> Organizations { get; set; }
/// <summary>
/// 消防力量。
/// </summary>
public DbSet<FireForce> FireForces { get; set; }
#endregion
#region 指挥员战术战法培训子系统
/// <summary>
/// 单位类型。
/// </summary>
public DbSet<BuildingType> BuildingTypes { get; set; }
/// <summary>
/// 课件。
/// </summary>
public DbSet<Courseware> Coursewares { get; set; }
#endregion
#region 多角色桌面推演
/// <summary>
/// 灾情。
/// </summary>
public DbSet<Disaster> Disasters { get; set; }
#endregion
/// <summary>
/// 创建一个数据库上下文实例。
/// </summary>
/// <param name="options"></param>
public DriveDbContext(DbContextOptions<DriveDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
#region 公用部分
modelBuilder.ApplyConfiguration(new UserConfig());
modelBuilder.ApplyConfiguration(new UserPostConfig());
modelBuilder.ApplyConfiguration(new StudyRecordConfig());
#endregion
#region 指挥员战术战法培训子系统 - 模板基本信息
modelBuilder.ApplyConfiguration(new TemplateBuildingAdjoinConfig());
modelBuilder.ApplyConfiguration(new TemplateImageMarkerConfig());
modelBuilder.ApplyConfiguration(new TemplateNoParkingAreaConfig());
modelBuilder.ApplyConfiguration(new TemplateImportantLocationConfig());
modelBuilder.ApplyConfiguration(new TemplateFireControlRoomConfig());
modelBuilder.ApplyConfiguration(new TemplateExitConfig());
modelBuilder.ApplyConfiguration(new TemplateProtectedStairwayConfig());
modelBuilder.ApplyConfiguration(new TemplateFireLiftConfig());
modelBuilder.ApplyConfiguration(new TemplatePumpRoomConfig());
modelBuilder.ApplyConfiguration(new TemplateSiameseConnectionConfig());
modelBuilder.ApplyConfiguration(new TemplateOutdoorFireHydrantConfig());
modelBuilder.ApplyConfiguration(new TemplateMunicipalFireHydrantConfig());
modelBuilder.ApplyConfiguration(new TemplateStorageTankConfig());
modelBuilder.ApplyConfiguration(new TemplateFoamPumpRoomConfig());
modelBuilder.ApplyConfiguration(new TemplateWaterTankConfig());
modelBuilder.ApplyConfiguration(new TemplateFireWaterMonitorConfig());
modelBuilder.ApplyConfiguration(new TemplateFoamHydrantConfig());
modelBuilder.ApplyConfiguration(new TemplateOrganizationConfig());
modelBuilder.ApplyConfiguration(new TemplateFireForceConfig());
#endregion
#region 指挥员战术战法培训子系统 - 基本信息
modelBuilder.ApplyConfiguration(new BuildingBasicInfoConfig());
modelBuilder.ApplyConfiguration(new BuildingFeatureConfig());
modelBuilder.ApplyConfiguration(new DriveRouteConfig());
modelBuilder.ApplyConfiguration(new PeripheralWaterSourceConfig());
modelBuilder.ApplyConfiguration(new BuildingAdjoinConfig());
modelBuilder.ApplyConfiguration(new ImageMarkerConfig());
modelBuilder.ApplyConfiguration(new NoParkingAreaConfig());
modelBuilder.ApplyConfiguration(new ImportantLocationConfig());
modelBuilder.ApplyConfiguration(new FireControlRoomConfig());
modelBuilder.ApplyConfiguration(new ExitConfig());
modelBuilder.ApplyConfiguration(new ProtectedStairwayConfig());
modelBuilder.ApplyConfiguration(new FireLiftConfig());
modelBuilder.ApplyConfiguration(new PumpRoomConfig());
modelBuilder.ApplyConfiguration(new SiameseConnectionConfig());
modelBuilder.ApplyConfiguration(new OutdoorFireHydrantConfig());
modelBuilder.ApplyConfiguration(new MunicipalFireHydrantConfig());
modelBuilder.ApplyConfiguration(new StorageTankConfig());
modelBuilder.ApplyConfiguration(new FoamPumpRoomConfig());
modelBuilder.ApplyConfiguration(new WaterTankConfig());
modelBuilder.ApplyConfiguration(new FireWaterMonitorConfig());
modelBuilder.ApplyConfiguration(new FoamHydrantConfig());
modelBuilder.ApplyConfiguration(new OrganizationConfig());
modelBuilder.ApplyConfiguration(new FireForceConfig());
#endregion
#region 指挥员战术战法培训子系统
modelBuilder.ApplyConfiguration(new CoursewareConfig());
modelBuilder.ApplyConfiguration(new CoursewareBuildingTypeConfig());
#endregion
#region 多角色桌面推演
modelBuilder.ApplyConfiguration(new DisasterConfig());
modelBuilder.ApplyConfiguration(new DisasterBuildingTypeConfig());
#endregion
}
}
}