// Backend/MotoresArgentinosV2.Infrastructure/Data/InternetDbContext.cs
using Microsoft.EntityFrameworkCore;
using MotoresArgentinosV2.Core.DTOs;
namespace MotoresArgentinosV2.Infrastructure.Data;
///
/// Contexto de Entity Framework para la base de datos Internet (legacy)
/// Servidor: ...
/// Base de Datos: internet
/// Propósito: Acceso a datos de avisos web
///
public class InternetDbContext : DbContext
{
public InternetDbContext(DbContextOptions 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(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)");
});
}
}