From 67a3f390d25ab19e20326fe319d160a91577b966 Mon Sep 17 00:00:00 2001 From: fulviocanducci Date: Tue, 13 Oct 2020 18:59:21 -0300 Subject: [PATCH] EF 5 RC2 --- Canducci.SoftDelete/Canducci.SoftDelete.csproj | 2 +- EF5CoreSoftDelete/EF5CoreSoftDelete.csproj | 5 +++-- EF5CoreSoftDelete/Program.cs | 6 +++--- EF5CoreSoftDelete/Services/DatabaseContext.cs | 4 ++++ UnitTestSoftDelete/UnitTestSoftDelete.csproj | 11 +++++++---- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Canducci.SoftDelete/Canducci.SoftDelete.csproj b/Canducci.SoftDelete/Canducci.SoftDelete.csproj index 7352662..32373f5 100644 --- a/Canducci.SoftDelete/Canducci.SoftDelete.csproj +++ b/Canducci.SoftDelete/Canducci.SoftDelete.csproj @@ -18,7 +18,7 @@ - 5.0.0-rc.1.20451.13 + 5.0.0-rc.2.20475.6 diff --git a/EF5CoreSoftDelete/EF5CoreSoftDelete.csproj b/EF5CoreSoftDelete/EF5CoreSoftDelete.csproj index 9f6d7b1..c2c7f70 100644 --- a/EF5CoreSoftDelete/EF5CoreSoftDelete.csproj +++ b/EF5CoreSoftDelete/EF5CoreSoftDelete.csproj @@ -6,11 +6,12 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/EF5CoreSoftDelete/Program.cs b/EF5CoreSoftDelete/Program.cs index c9396a7..69ccc96 100644 --- a/EF5CoreSoftDelete/Program.cs +++ b/EF5CoreSoftDelete/Program.cs @@ -61,9 +61,9 @@ static void Main(string[] args) //db.House.Remove(db.House.Find(1)); //db.SaveChanges(); - //var animal = db.Animal.AsNoTrackingWithIdentityResolution().ToList(); - //var peoples = db.People.AsNoTrackingWithIdentityResolution().ToList(); - //var house = db.House.AsNoTrackingWithIdentityResolution().ToList(); + var animal = db.Animal.AsNoTrackingWithIdentityResolution().ToList(); + var peoples = db.People.AsNoTrackingWithIdentityResolution().ToList(); + var house = db.House.AsNoTrackingWithIdentityResolution().ToList(); } diff --git a/EF5CoreSoftDelete/Services/DatabaseContext.cs b/EF5CoreSoftDelete/Services/DatabaseContext.cs index 89c8607..2446019 100644 --- a/EF5CoreSoftDelete/Services/DatabaseContext.cs +++ b/EF5CoreSoftDelete/Services/DatabaseContext.cs @@ -1,6 +1,7 @@ using Canducci.SoftDelete.Extensions; using EF5CoreSoftDelete.Models; using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; namespace EF5CoreSoftDelete.Services { @@ -10,6 +11,7 @@ public class DatabaseContext : DbContext public DbSet People { get; set; } public DbSet House { get; set; } + public static readonly ILoggerFactory MyLoggerFactory = LoggerFactory.Create(builder => { builder.AddConsole(); }); protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseSqlite("Data Source = db.db", options => @@ -18,6 +20,8 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) .AddInterceptorSoftDeleteChar() .AddInterceptorSoftDeleteBool() .AddInterceptorSoftDeleteDateTime(); + + optionsBuilder.UseLoggerFactory(MyLoggerFactory); } protected override void OnModelCreating(ModelBuilder modelBuilder) { diff --git a/UnitTestSoftDelete/UnitTestSoftDelete.csproj b/UnitTestSoftDelete/UnitTestSoftDelete.csproj index 130a48b..528f442 100644 --- a/UnitTestSoftDelete/UnitTestSoftDelete.csproj +++ b/UnitTestSoftDelete/UnitTestSoftDelete.csproj @@ -7,10 +7,13 @@ - - - - + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive +