Skip to content

Instantly share code, notes, and snippets.

@Beelzenef
Last active June 10, 2020 18:24
Show Gist options
  • Save Beelzenef/a3a956a2f39bc750d34b106f6e6a643a to your computer and use it in GitHub Desktop.
Save Beelzenef/a3a956a2f39bc750d34b106f6e6a643a to your computer and use it in GitHub Desktop.
Ejemplo de DbContext para medium.com/puntotech
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