Last active
June 10, 2020 18:24
-
-
Save Beelzenef/a3a956a2f39bc750d34b106f6e6a643a to your computer and use it in GitHub Desktop.
Ejemplo de DbContext para medium.com/puntotech
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.EntityFrameworkCore; | |
namespace PuntoTechApp | |
{ | |
public class MyContext : DbContext | |
{ | |
protected override void OnConfiguring(DbContextOptionsBuilder options) | |
{ | |
if (!options.IsConfigured) | |
{ | |
IConfigurationRoot configuration = new ConfigurationBuilder() | |
.Build(); | |
options.UseSqlServer("Server=localhost;Database=PuntoTechApp;Trusted_Connection=True;").EnableSensitiveDataLogging(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment