phronCare/Models/Models/PhronCareOperationsHubContext.cs

61 lines
2.2 KiB
C#

using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace Models.Models;
public partial class PhronCareOperationsHubContext : DbContext
{
public PhronCareOperationsHubContext()
{
}
public PhronCareOperationsHubContext(DbContextOptions<PhronCareOperationsHubContext> options)
: base(options)
{
}
public virtual DbSet<PhOhTicket> PhOhTickets { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
#region VERSION DOCKER
//{
// if (!optionsBuilder.IsConfigured)
// {
// // Dejarlo vacío para usar la configuración externa desde Program.cs o Startup.cs
// }
//}
#endregion
=> optionsBuilder.UseSqlServer("Server=ROG-\\SQLEXPRESS;Database=phronCare_OperationsHub;Integrated Security=True;TrustServerCertificate=True;MultipleActiveResultSets=True;");
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.UseCollation("Modern_Spanish_CI_AS");
modelBuilder.Entity<PhOhTicket>(entity =>
{
entity.HasKey(e => e.TicketId).HasName("PK__PhOH_Tic__712CC607C3A58A28");
entity.ToTable("PhOH_Tickets");
entity.Property(e => e.TicketId).HasDefaultValueSql("(newid())");
entity.Property(e => e.AsignadoAusuarioId)
.HasMaxLength(128)
.HasColumnName("AsignadoAUsuarioId");
entity.Property(e => e.Categoria).HasMaxLength(50);
entity.Property(e => e.CreadorUsuarioId).HasMaxLength(128);
entity.Property(e => e.Departamento).HasMaxLength(50);
entity.Property(e => e.Estado).HasMaxLength(50);
entity.Property(e => e.FechaCreacion).HasColumnType("datetime");
entity.Property(e => e.FechaEjecucion).HasColumnType("datetime");
entity.Property(e => e.Impacto).HasMaxLength(50);
entity.Property(e => e.Prioridad).HasMaxLength(50);
entity.Property(e => e.Urgencia).HasMaxLength(50);
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}