Init Commit

This commit is contained in:
2026-01-29 13:43:44 -03:00
commit b9aa8478db
126 changed files with 20649 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
// Backend/MotoresArgentinosV2.Infrastructure/Data/InternetDbContext.cs
using Microsoft.EntityFrameworkCore;
using MotoresArgentinosV2.Core.DTOs;
namespace MotoresArgentinosV2.Infrastructure.Data;
/// <summary>
/// Contexto de Entity Framework para la base de datos Internet (legacy)
/// Servidor: ...
/// Base de Datos: internet
/// Propósito: Acceso a datos de avisos web
/// </summary>
public class InternetDbContext : DbContext
{
public InternetDbContext(DbContextOptions<InternetDbContext> options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
// Registrar el DTO como entidad sin llave (Keyless) para que SqlQueryRaw funcione bien
modelBuilder.Entity<DatosAvisoDto>(e =>
{
e.HasNoKey();
e.ToView(null); // No mapea a tabla
// Configurar precisión de decimales para silenciar warnings
e.Property(p => p.ImporteSiniva).HasColumnType("decimal(18,2)");
e.Property(p => p.ImporteTotsiniva).HasColumnType("decimal(18,2)");
e.Property(p => p.PorcentajeCombinado).HasColumnType("decimal(18,2)");
e.Property(p => p.Centimetros).HasColumnType("decimal(18,2)");
});
}
}