using Exam.Models;
using Microsoft.EntityFrameworkCore;

namespace Exam.Context
{
    public class DataContext : DbContext
    {
        public DataContext(DbContextOptions<DataContext> options) : base(options)
        {
        }

        public DbSet<Flight> Flights { get; set; }
        public DbSet<Hotel> Hotels { get; set; }
        public DbSet<Reservation> Reservations { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Flight>(f =>
            {
                f.Property<int>("FlightId").HasColumnName("flightId");
                f.Property<DateTime>("Date").HasColumnName("date");
                f.Property<string>("DestinationCity").HasColumnName("destinationCity");
                f.Property<int>("AvailableSeats").HasColumnName("availableSeats");
            });
            modelBuilder.Entity<Hotel>(f =>
            {
                f.Property<int>("HotelId").HasColumnName("hotelId");
                f.Property<DateTime>("Date").HasColumnName("date");
                f.Property<string>("HotelName").HasColumnName("hotelname");
                f.Property<string>("City").HasColumnName("city");
                f.Property<int>("AvailableRooms").HasColumnName("availableRooms");
            });
            modelBuilder.Entity<Reservation>(f =>
            {
                f.Property<int>("Id").HasColumnName("id");
                f.Property<DateTime>("Date").HasColumnName("date");
                f.Property<string>("Person").HasColumnName("person");
                f.Property<string>("Type").HasColumnName("type");
                f.Property<int>("IdReservedResource").HasColumnName("idReservedResource");
            });

        }
    }
}
