mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2025-12-06 05:32:03 +01:00
17 lines
444 B
C#
17 lines
444 B
C#
using Microsoft.EntityFrameworkCore; // DbContext, DbSet<T>
|
|
|
|
namespace Packt.Shared;
|
|
|
|
public class Northwind : DbContext
|
|
{
|
|
public DbSet<Customer> Customers { get; set; } = null!;
|
|
|
|
protected override void OnConfiguring(
|
|
DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
string path = Path.Combine(Environment.CurrentDirectory, "Northwind.db");
|
|
string connection = $"Filename={path}";
|
|
optionsBuilder.UseSqlite(connection);
|
|
}
|
|
}
|