Skip to content

Commit

Permalink
EF 5 RC2
Browse files Browse the repository at this point in the history
  • Loading branch information
fulviocanducci committed Oct 13, 2020
1 parent fadd191 commit 67a3f39
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Canducci.SoftDelete/Canducci.SoftDelete.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="Microsoft.EntityFrameworkCore">
<Version>5.0.0-rc.1.20451.13</Version>
<Version>5.0.0-rc.2.20475.6</Version>
</PackageReference>
</ItemGroup>

Expand Down
5 changes: 3 additions & 2 deletions EF5CoreSoftDelete/EF5CoreSoftDelete.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.0-rc.1.20451.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.0-rc.1.20451.13">
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.0-rc.2.20475.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.0-rc.2.20475.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0-rc.2.20475.5" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions EF5CoreSoftDelete/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

}

Expand Down
4 changes: 4 additions & 0 deletions EF5CoreSoftDelete/Services/DatabaseContext.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Canducci.SoftDelete.Extensions;
using EF5CoreSoftDelete.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;

namespace EF5CoreSoftDelete.Services
{
Expand All @@ -10,6 +11,7 @@ public class DatabaseContext : DbContext
public DbSet<People> People { get; set; }
public DbSet<House> 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 =>
Expand All @@ -18,6 +20,8 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
.AddInterceptorSoftDeleteChar()
.AddInterceptorSoftDeleteBool()
.AddInterceptorSoftDeleteDateTime();

optionsBuilder.UseLoggerFactory(MyLoggerFactory);
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
Expand Down
11 changes: 7 additions & 4 deletions UnitTestSoftDelete/UnitTestSoftDelete.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.0" />
<PackageReference Include="coverlet.collector" Version="1.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="coverlet.collector" Version="1.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 67a3f39

Please sign in to comment.