avansando más

This commit is contained in:
2025-04-17 13:24:07 -03:00
parent 6fb6ade153
commit c1a27baedd
15 changed files with 477 additions and 262 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System;
using System.Collections.Generic;
using System.Text.Json;
using Microsoft.EntityFrameworkCore;
namespace Entidades;
@@ -53,9 +54,16 @@ public partial class AlquilaFacilContext : DbContext
public virtual DbSet<Venta> Ventas { get; set; }
private class context
{
public string connectiondb { get; set; } = "";
}
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=127.0.0.1;Port=3306;Database=AlquilaFacil;Uid=AlquilaFacil;Pwd=.n@9c2ve*0,b1ETv].Kipa/~pR~V;Connection Timeout=5;SslMode=none");
{
context connection = JsonSerializer.Deserialize<context>(File.ReadAllText("settings.json")) ?? new();
optionsBuilder.UseMySQL(connection.connectiondb);
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{