Actualizacion de las entidades
This commit is contained in:
@@ -37,11 +37,10 @@ public partial class AlquilaFacilContext : DbContext
|
|||||||
|
|
||||||
public virtual DbSet<Recibo> Recibos { get; set; }
|
public virtual DbSet<Recibo> Recibos { get; set; }
|
||||||
|
|
||||||
public virtual DbSet<Usuario> Usuarios { get; set; }
|
|
||||||
|
|
||||||
public virtual DbSet<Venta> Ventas { get; set; }
|
public virtual DbSet<Venta> Ventas { get; set; }
|
||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
|
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
|
||||||
=> optionsBuilder.UseMySQL("Server=fedesrv.ddns.net;Port=30006;Database=AlquilaFacil;Uid=AlquilaFacil;Pwd=.n@9c2ve*0,b1ETv].Kipa/~pR~V;Connection Timeout=5;SslMode=none");
|
=> optionsBuilder.UseMySQL("Server=fedesrv.ddns.net;Port=30006;Database=AlquilaFacil;Uid=AlquilaFacil;Pwd=.n@9c2ve*0,b1ETv].Kipa/~pR~V;Connection Timeout=5;SslMode=none");
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
@@ -75,14 +74,32 @@ public partial class AlquilaFacilContext : DbContext
|
|||||||
entity.Property(e => e.dni).HasColumnType("bigint(20)");
|
entity.Property(e => e.dni).HasColumnType("bigint(20)");
|
||||||
entity.Property(e => e.apellido).HasMaxLength(20);
|
entity.Property(e => e.apellido).HasMaxLength(20);
|
||||||
entity.Property(e => e.celular).HasMaxLength(40);
|
entity.Property(e => e.celular).HasMaxLength(40);
|
||||||
|
entity.Property(e => e.contraseña).HasMaxLength(128);
|
||||||
entity.Property(e => e.domicilio).HasMaxLength(40);
|
entity.Property(e => e.domicilio).HasMaxLength(40);
|
||||||
|
entity.Property(e => e.email).HasMaxLength(50);
|
||||||
entity.Property(e => e.idusuario).HasColumnType("int(11)");
|
entity.Property(e => e.idusuario).HasColumnType("int(11)");
|
||||||
entity.Property(e => e.nombre).HasMaxLength(20);
|
entity.Property(e => e.nombre).HasMaxLength(20);
|
||||||
|
entity.Property(e => e.token).HasColumnType("text");
|
||||||
|
|
||||||
entity.HasOne(d => d.idusuarioNavigation).WithMany(p => p.Clientes)
|
entity.HasMany(d => d.idgrupos).WithMany(p => p.idclientes)
|
||||||
.HasForeignKey(d => d.idusuario)
|
.UsingEntity<Dictionary<string, object>>(
|
||||||
.OnDelete(DeleteBehavior.Restrict)
|
"cliente_Grupo",
|
||||||
.HasConstraintName("FK_PROP_USU");
|
r => r.HasOne<Grupo>().WithMany()
|
||||||
|
.HasForeignKey("idgrupo")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.HasConstraintName("FK_GRU"),
|
||||||
|
l => l.HasOne<Cliente>().WithMany()
|
||||||
|
.HasForeignKey("idcliente")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.HasConstraintName("FK_CLII"),
|
||||||
|
j =>
|
||||||
|
{
|
||||||
|
j.HasKey("idcliente", "idgrupo").HasName("PRIMARY");
|
||||||
|
j.ToTable("cliente_Grupos");
|
||||||
|
j.HasIndex(new[] { "idgrupo" }, "FK_GRU");
|
||||||
|
j.IndexerProperty<long>("idcliente").HasColumnType("bigint(20)");
|
||||||
|
j.IndexerProperty<int>("idgrupo").HasColumnType("int(11)");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<Contrato>(entity =>
|
modelBuilder.Entity<Contrato>(entity =>
|
||||||
@@ -295,36 +312,6 @@ public partial class AlquilaFacilContext : DbContext
|
|||||||
entity.Property(e => e.monto).HasPrecision(12);
|
entity.Property(e => e.monto).HasPrecision(12);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<Usuario>(entity =>
|
|
||||||
{
|
|
||||||
entity.HasKey(e => e.id).HasName("PRIMARY");
|
|
||||||
|
|
||||||
entity.Property(e => e.id).HasColumnType("int(11)");
|
|
||||||
entity.Property(e => e.contraseña).HasMaxLength(128);
|
|
||||||
entity.Property(e => e.email).HasMaxLength(50);
|
|
||||||
entity.Property(e => e.token).HasColumnType("text");
|
|
||||||
|
|
||||||
entity.HasMany(d => d.idgrupos).WithMany(p => p.idusuarios)
|
|
||||||
.UsingEntity<Dictionary<string, object>>(
|
|
||||||
"usuario_Grupo",
|
|
||||||
r => r.HasOne<Grupo>().WithMany()
|
|
||||||
.HasForeignKey("idgrupo")
|
|
||||||
.OnDelete(DeleteBehavior.Restrict)
|
|
||||||
.HasConstraintName("FK_GRU"),
|
|
||||||
l => l.HasOne<Usuario>().WithMany()
|
|
||||||
.HasForeignKey("idusuario")
|
|
||||||
.OnDelete(DeleteBehavior.Restrict)
|
|
||||||
.HasConstraintName("FK_USU"),
|
|
||||||
j =>
|
|
||||||
{
|
|
||||||
j.HasKey("idusuario", "idgrupo").HasName("PRIMARY");
|
|
||||||
j.ToTable("usuario_Grupos");
|
|
||||||
j.HasIndex(new[] { "idgrupo" }, "FK_GRU");
|
|
||||||
j.IndexerProperty<int>("idusuario").HasColumnType("int(11)");
|
|
||||||
j.IndexerProperty<int>("idgrupo").HasColumnType("int(11)");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity<Venta>(entity =>
|
modelBuilder.Entity<Venta>(entity =>
|
||||||
{
|
{
|
||||||
entity.HasKey(e => e.id).HasName("PRIMARY");
|
entity.HasKey(e => e.id).HasName("PRIMARY");
|
||||||
|
|||||||
@@ -17,6 +17,12 @@ public partial class Cliente
|
|||||||
|
|
||||||
public int? idusuario { get; set; }
|
public int? idusuario { get; set; }
|
||||||
|
|
||||||
|
public string email { get; set; } = null!;
|
||||||
|
|
||||||
|
public byte[] contraseña { get; set; } = null!;
|
||||||
|
|
||||||
|
public string? token { get; set; }
|
||||||
|
|
||||||
public virtual ICollection<Contrato> ContratodniinquilinoNavigations { get; set; } = new List<Contrato>();
|
public virtual ICollection<Contrato> ContratodniinquilinoNavigations { get; set; } = new List<Contrato>();
|
||||||
|
|
||||||
public virtual ICollection<Contrato> ContratodnipropietarioNavigations { get; set; } = new List<Contrato>();
|
public virtual ICollection<Contrato> ContratodnipropietarioNavigations { get; set; } = new List<Contrato>();
|
||||||
@@ -27,5 +33,5 @@ public partial class Cliente
|
|||||||
|
|
||||||
public virtual ICollection<Venta> Ventaidprop_oldNavigations { get; set; } = new List<Venta>();
|
public virtual ICollection<Venta> Ventaidprop_oldNavigations { get; set; } = new List<Venta>();
|
||||||
|
|
||||||
public virtual Usuario? idusuarioNavigation { get; set; }
|
public virtual ICollection<Grupo> idgrupos { get; set; } = new List<Grupo>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ public partial class Grupo
|
|||||||
|
|
||||||
public string nombre { get; set; } = null!;
|
public string nombre { get; set; } = null!;
|
||||||
|
|
||||||
public virtual ICollection<Permiso> idpermisos { get; set; } = new List<Permiso>();
|
public virtual ICollection<Cliente> idclientes { get; set; } = new List<Cliente>();
|
||||||
|
|
||||||
public virtual ICollection<Usuario> idusuarios { get; set; } = new List<Usuario>();
|
public virtual ICollection<Permiso> idpermisos { get; set; } = new List<Permiso>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace Entidades;
|
|
||||||
|
|
||||||
public partial class Usuario
|
|
||||||
{
|
|
||||||
public int id { get; set; }
|
|
||||||
|
|
||||||
public string email { get; set; } = null!;
|
|
||||||
|
|
||||||
public byte[] contraseña { get; set; } = null!;
|
|
||||||
|
|
||||||
public string? token { get; set; }
|
|
||||||
|
|
||||||
public virtual ICollection<Cliente> Clientes { get; set; } = new List<Cliente>();
|
|
||||||
|
|
||||||
public virtual ICollection<Grupo> idgrupos { get; set; } = new List<Grupo>();
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user