SUBD/CarRentDatabase/CarRentDatabase.cs

28 lines
812 B
C#

using CarRentDatabase.Models;
using Microsoft.EntityFrameworkCore;
using System.Numerics;
using System.Reflection.Metadata;
namespace CarRentDatabase
{
public class CarRentDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseNpgsql(@"
Host=192.168.56.101;
Port=5432;
Database=SUBDLab4;
Username=postgres;
Password=123");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Branch> Branches { set; get; }
public virtual DbSet<Car> Cars { set; get; }
public virtual DbSet<Client> Clients { set; get; }
public virtual DbSet<Rental> Rentals { set; get; }
}
}