29 lines
857 B
C#
29 lines
857 B
C#
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using vita_asistente.Data.Models;
|
|
using vita_asistente.Models;
|
|
|
|
namespace vita_asistente.Data
|
|
{
|
|
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
|
|
{
|
|
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
|
|
: base(options)
|
|
{
|
|
}
|
|
|
|
// DbSet for Paciente model
|
|
public DbSet<Paciente> Pacientes { get; set; }
|
|
|
|
protected override void OnModelCreating(ModelBuilder builder)
|
|
{
|
|
base.OnModelCreating(builder);
|
|
|
|
builder.Entity<ApplicationUser>().ToTable("AspNetUsers");
|
|
builder.Entity<Paciente>()
|
|
.ToTable("Pacientes")
|
|
.HasBaseType<ApplicationUser>();
|
|
}
|
|
}
|
|
}
|