using Microsoft.EntityFrameworkCore;
using Silk_Road_Api.Models;

namespace Silk_Road_Api.DatabaseContext;

public class SilkRoadApiContext : DbContext
{
    public SilkRoadApiContext(DbContextOptions options) : base(options)
    {
        this.Options = options;
    }

    internal DbContextOptions Options { get; }

    public DbSet<Drug> Drugs { get; set; }

    public DbSet<User> Users { get; set; }

    public DbSet<Manufacturer> Manufacturers { get; set; }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.Entity<Drug>().ToTable("Drugs");
        modelBuilder.Entity<Manufacturer>().ToTable("Manufacturers");
        modelBuilder.Entity<User>().ToTable("Users");
    }

}
