dev #48
@@ -39,6 +39,8 @@ public partial class AlquilaFacilContext : DbContext
|
||||
|
||||
public virtual DbSet<Recibo> Recibos { get; set; }
|
||||
|
||||
public virtual DbSet<Servicio> Servicios { get; set; }
|
||||
|
||||
public virtual DbSet<TipoPropiedad> TipoPropiedads { get; set; }
|
||||
|
||||
public virtual DbSet<Venta> Ventas { get; set; }
|
||||
@@ -473,6 +475,42 @@ public partial class AlquilaFacilContext : DbContext
|
||||
.HasColumnName("monto");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Servicio>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Id).HasName("PRIMARY");
|
||||
|
||||
entity.Property(e => e.Id)
|
||||
.HasColumnType("int(11)")
|
||||
.HasColumnName("id");
|
||||
entity.Property(e => e.Descripcion)
|
||||
.HasMaxLength(20)
|
||||
.HasColumnName("descripcion");
|
||||
|
||||
entity.HasMany(d => d.IdPropiedads).WithMany(p => p.IdServicios)
|
||||
.UsingEntity<Dictionary<string, object>>(
|
||||
"ServicioPropiedad",
|
||||
r => r.HasOne<Propiedade>().WithMany()
|
||||
.HasForeignKey("IdPropiedad")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.HasConstraintName("Servicio_Propiedad_ibfk_2"),
|
||||
l => l.HasOne<Servicio>().WithMany()
|
||||
.HasForeignKey("IdServicio")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.HasConstraintName("Servicio_Propiedad_ibfk_1"),
|
||||
j =>
|
||||
{
|
||||
j.HasKey("IdServicio", "IdPropiedad").HasName("PRIMARY");
|
||||
j.ToTable("Servicio_Propiedad");
|
||||
j.HasIndex(new[] { "IdPropiedad" }, "idPropiedad");
|
||||
j.IndexerProperty<int>("IdServicio")
|
||||
.HasColumnType("int(11)")
|
||||
.HasColumnName("idServicio");
|
||||
j.IndexerProperty<int>("IdPropiedad")
|
||||
.HasColumnType("int(11)")
|
||||
.HasColumnName("idPropiedad");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity<TipoPropiedad>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Id).HasName("PRIMARY");
|
||||
|
||||
@@ -30,4 +30,6 @@ public partial class Propiedade
|
||||
public virtual TipoPropiedad IdtipropiedadNavigation { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<Venta> Venta { get; set; } = new List<Venta>();
|
||||
|
||||
public virtual ICollection<Servicio> IdServicios { get; set; } = new List<Servicio>();
|
||||
}
|
||||
|
||||
13
Entidades/Servicio.cs
Normal file
13
Entidades/Servicio.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Entidades;
|
||||
|
||||
public partial class Servicio
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Descripcion { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<Propiedade> IdPropiedads { get; set; } = new List<Propiedade>();
|
||||
}
|
||||
Reference in New Issue
Block a user