avansando más
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
namespace Entidades.Dto;
|
||||
public class GrupoDto
|
||||
{
|
||||
public int idgrupo { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user