F2 avanzada
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using vita_asistente.Data.Models;
|
||||
using vita_asistente.Models;
|
||||
|
||||
namespace vita_asistente.Data
|
||||
@@ -10,5 +11,18 @@ namespace vita_asistente.Data
|
||||
: 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>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using vita_asistente.Models;
|
||||
|
||||
namespace vita_asistente.Data.Models
|
||||
{
|
||||
public class Paciente : ApplicationUser
|
||||
{
|
||||
[StringLength(100)]
|
||||
public string NombreContactoEmergencia { get; set; } = string.Empty;
|
||||
|
||||
[StringLength(50)]
|
||||
public string TelefonoContactoEmergencia { get; set; } = string.Empty;
|
||||
|
||||
[StringLength(50)]
|
||||
public string TipoSangre { get; set; } = string.Empty;
|
||||
|
||||
public bool TieneAlergiasMedicamentosas { get; set; }
|
||||
|
||||
[StringLength(500)]
|
||||
public string AlergiasDescripcion { get; set; } = string.Empty;
|
||||
|
||||
public DateTime FechaRegistro { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the patient account is active and can log in
|
||||
/// </summary>
|
||||
public bool IsActive { get; set; } = true; // Default to active
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user