From 203d6245bc3fc097acd94a3df4898948946cdf79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Chevaldonn=C3=A9?= Date: Tue, 31 Dec 2019 20:56:26 +0100 Subject: [PATCH] updated sample about InMemory --- .../ex_041_004_InMemory/NounoursContext.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 p08_BDD_EntityFramework/ex_041_004_InMemory/NounoursContext.cs diff --git a/p08_BDD_EntityFramework/ex_041_004_InMemory/NounoursContext.cs b/p08_BDD_EntityFramework/ex_041_004_InMemory/NounoursContext.cs new file mode 100644 index 0000000..0e76015 --- /dev/null +++ b/p08_BDD_EntityFramework/ex_041_004_InMemory/NounoursContext.cs @@ -0,0 +1,24 @@ +using Microsoft.EntityFrameworkCore; + +namespace ex_041_004_InMemory +{ + public class NounoursContext : DbContext + { + public DbSet Nounours { get; set; } + + public NounoursContext() + { } + + public NounoursContext(DbContextOptions options) + : base(options) + { } + + protected override void OnConfiguring(DbContextOptionsBuilder options) + { + if (!options.IsConfigured) + { + options.UseSqlServer(@"Server=(localdb)\mssqllocaldb;Database=ex_041_004_InMemory.Nounours.mdf;Trusted_Connection=True;"); + } + } + } +}