Creating DbContext and Models repository
This commit is contained in:
27
PyroFetes/PyroFetesDbContext.cs
Normal file
27
PyroFetes/PyroFetesDbContext.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace PyroFetes;
|
||||
|
||||
public class PyroFetesDbContext : DbContext
|
||||
{
|
||||
// Entities
|
||||
|
||||
|
||||
// Database configuration
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
string connectionString =
|
||||
"Server=romaric-thibault.fr;" +
|
||||
"Database=PyroFetes;" +
|
||||
"User Id=pyrofetes;" +
|
||||
"Password=Onto9-Cage-Afflicted;" +
|
||||
"TrustServerCertificate=true;";
|
||||
|
||||
optionsBuilder.UseSqlServer(connectionString);
|
||||
}
|
||||
|
||||
// Models customization
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user