using System.Reflection; using AutobusApi.Application.Common.Interfaces; using AutobusApi.Domain.Entities; using Microsoft.EntityFrameworkCore; namespace AutoubsApi.Infrastructure.Data; public class ApplicationDbContext : DbContext, IApplicationDbContext { public ApplicationDbContext(DbContextOptions options) : base(options) { } public DbSet Countries { get => Set(); } public DbSet Regions { get => Set(); } public DbSet Cities { get => Set(); } public DbSet
Addresses { get => Set
(); } public DbSet RouteAddresses { get => Set(); } public DbSet Routes { get => Set(); } public DbSet RouteAddressDetails { get => Set(); } public DbSet VehicleEnrollments { get => Set(); } public DbSet Vehicles { get => Set(); } public DbSet Buses { get => Set(); } public DbSet Aircraft { get => Set(); } public DbSet Trains { get => Set(); } public DbSet TrainCarriages { get => Set(); } public DbSet Carriages { get => Set(); } public DbSet Companies { get => Set(); } public DbSet Employees { get => Set(); } public DbSet EmployeeDocuments { get => Set(); } public DbSet vehicleEnrollmentEmployees { get => Set(); } public DbSet ApplicationUsers { get => Set(); } public DbSet TicketGroups { get => Set(); } public DbSet Tickets { get => Set(); } public DbSet TicketDocuments { get => Set(); } public DbSet Reviews { get => Set(); } protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder); builder.HasPostgresExtension("postgis"); builder.HasDefaultSchema("domain"); builder.ApplyConfigurationsFromAssembly( Assembly.GetExecutingAssembly(), t => t.Namespace == "AutobusApi.Infrastructure.Data.Configurations" ); } }