migracion
This commit is contained in:
@@ -318,17 +318,20 @@ public partial class AlquilaFacilContext : DbContext
|
|||||||
|
|
||||||
modelBuilder.Entity<Garante>(entity =>
|
modelBuilder.Entity<Garante>(entity =>
|
||||||
{
|
{
|
||||||
entity.HasKey(e => e.Dni).HasName("PRIMARY");
|
entity.HasKey(e => e.Id).HasName("PRIMARY");
|
||||||
|
|
||||||
entity.Property(e => e.Dni)
|
entity.Property(e => e.Id)
|
||||||
.HasColumnType("bigint(20)")
|
.HasColumnType("int(11)")
|
||||||
.HasColumnName("dni");
|
.HasColumnName("id");
|
||||||
entity.Property(e => e.Apellido)
|
entity.Property(e => e.Apellido)
|
||||||
.HasMaxLength(20)
|
.HasMaxLength(20)
|
||||||
.HasColumnName("apellido");
|
.HasColumnName("apellido");
|
||||||
entity.Property(e => e.Celular)
|
entity.Property(e => e.Celular)
|
||||||
.HasMaxLength(40)
|
.HasMaxLength(40)
|
||||||
.HasColumnName("celular");
|
.HasColumnName("celular");
|
||||||
|
entity.Property(e => e.Dni)
|
||||||
|
.HasColumnType("bigint(20)")
|
||||||
|
.HasColumnName("dni");
|
||||||
entity.Property(e => e.Domicilio)
|
entity.Property(e => e.Domicilio)
|
||||||
.HasMaxLength(40)
|
.HasMaxLength(40)
|
||||||
.HasColumnName("domicilio");
|
.HasColumnName("domicilio");
|
||||||
@@ -339,7 +342,7 @@ public partial class AlquilaFacilContext : DbContext
|
|||||||
.HasMaxLength(20)
|
.HasMaxLength(20)
|
||||||
.HasColumnName("nombre");
|
.HasColumnName("nombre");
|
||||||
|
|
||||||
entity.HasMany(d => d.Idcontratos).WithMany(p => p.Dnigarantes)
|
entity.HasMany(d => d.Idcontratos).WithMany(p => p.Idgarantes)
|
||||||
.UsingEntity<Dictionary<string, object>>(
|
.UsingEntity<Dictionary<string, object>>(
|
||||||
"ContratoGarante",
|
"ContratoGarante",
|
||||||
r => r.HasOne<Contrato>().WithMany()
|
r => r.HasOne<Contrato>().WithMany()
|
||||||
@@ -347,17 +350,17 @@ public partial class AlquilaFacilContext : DbContext
|
|||||||
.OnDelete(DeleteBehavior.Restrict)
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
.HasConstraintName("FK_CONGAR_CON"),
|
.HasConstraintName("FK_CONGAR_CON"),
|
||||||
l => l.HasOne<Garante>().WithMany()
|
l => l.HasOne<Garante>().WithMany()
|
||||||
.HasForeignKey("Dnigarante")
|
.HasForeignKey("Idgarante")
|
||||||
.OnDelete(DeleteBehavior.Restrict)
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
.HasConstraintName("FK_CONGAR_GAR"),
|
.HasConstraintName("FK_CONGAR_GAR"),
|
||||||
j =>
|
j =>
|
||||||
{
|
{
|
||||||
j.HasKey("Dnigarante", "Idcontrato").HasName("PRIMARY");
|
j.HasKey("Idgarante", "Idcontrato").HasName("PRIMARY");
|
||||||
j.ToTable("contrato_garantes");
|
j.ToTable("contrato_garantes");
|
||||||
j.HasIndex(new[] { "Idcontrato" }, "FK_CONGAR_CON");
|
j.HasIndex(new[] { "Idcontrato" }, "FK_CONGAR_CON");
|
||||||
j.IndexerProperty<long>("Dnigarante")
|
j.IndexerProperty<int>("Idgarante")
|
||||||
.HasColumnType("bigint(20)")
|
.HasColumnType("int(11)")
|
||||||
.HasColumnName("dnigarante");
|
.HasColumnName("idgarante");
|
||||||
j.IndexerProperty<long>("Idcontrato")
|
j.IndexerProperty<long>("Idcontrato")
|
||||||
.HasColumnType("bigint(20)")
|
.HasColumnType("bigint(20)")
|
||||||
.HasColumnName("idcontrato");
|
.HasColumnName("idcontrato");
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public partial class Contrato
|
|||||||
|
|
||||||
public virtual Venta? IdventaNavigation { get; set; }
|
public virtual Venta? IdventaNavigation { get; set; }
|
||||||
|
|
||||||
public virtual ICollection<Garante> Dnigarantes { get; set; } = new List<Garante>();
|
|
||||||
|
|
||||||
public virtual ICollection<Canon> Idcanons { get; set; } = new List<Canon>();
|
public virtual ICollection<Canon> Idcanons { get; set; } = new List<Canon>();
|
||||||
|
|
||||||
|
public virtual ICollection<Garante> Idgarantes { get; set; } = new List<Garante>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ namespace Entidades;
|
|||||||
|
|
||||||
public partial class Garante
|
public partial class Garante
|
||||||
{
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
public long Dni { get; set; }
|
public long Dni { get; set; }
|
||||||
|
|
||||||
public string Nombre { get; set; } = null!;
|
public string Nombre { get; set; } = null!;
|
||||||
|
|||||||
Reference in New Issue
Block a user