Skip to content

Commit 4b51cfb

Browse files
Merge branch 'master' into feature/GH0831_AddQuerySupportForDecimal
2 parents 33c985b + f81e6cc commit 4b51cfb

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

src/NHibernate.Example.Web/NHibernate.Example.Web.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net461</TargetFramework>
4+
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
5+
<DisableImplicitPackageTargetFallback>true</DisableImplicitPackageTargetFallback>
56
</PropertyGroup>
67

78
<ItemGroup>
@@ -14,10 +15,15 @@
1415
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0" />
1516
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation" Version="2.0.0" PrivateAssets="All" />
1617
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.0" />
18+
<PackageReference Include="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" />
1719
<PackageReference Include="Serilog.AspNetCore" Version="2.0.0" />
1820
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.0" />
1921
</ItemGroup>
2022

23+
<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp2.0'">
24+
<PackageReference Include="System.Data.SqlClient" Version="4.4.2" />
25+
</ItemGroup>
26+
2127
<ItemGroup>
2228
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
2329
</ItemGroup>

src/NHibernate.Example.Web/Pages/_Layout.cshtml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
<body>
3333
@RenderBody()
3434

35-
@RenderSection("Scripts", required: false)
35+
<p>
36+
@Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.RuntimeFramework
37+
</p>
38+
39+
@RenderSection("Scripts", required: false)
3640
</body>
3741
</html>

src/NHibernate.Test/Linq/ByMethod/WithOptionsTests.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ public void AppliesOptionsToQuery()
4141
query.Received(1).SetCacheMode(CacheMode.Normal);
4242
query.Received(1).SetCacheRegion("testregion");
4343
query.Received(1).SetTimeout(10);
44+
45+
// Prevent garbage collection of session substitute before end of test, since the Linq query provider
46+
// only has a weak reference on it.
47+
Assert.That(session, Is.Not.Null);
4448
}
4549

4650
[Test]
@@ -72,6 +76,10 @@ public void DoNotContaminateQueryWithOptions()
7276
query.Received(1).SetCacheMode(CacheMode.Normal);
7377
query.Received(1).SetCacheRegion("testregion");
7478
query.Received(1).SetTimeout(10);
79+
80+
// Prevent garbage collection of session substitute before end of test, since the Linq query provider
81+
// only has a weak reference on it.
82+
Assert.That(session, Is.Not.Null);
7583
}
7684

7785
[Test]
@@ -101,6 +109,10 @@ public async Task AppliesOptionsToQueryAsync()
101109
query.Received(1).SetCacheMode(CacheMode.Normal);
102110
query.Received(1).SetCacheRegion("testregion");
103111
query.Received(1).SetTimeout(10);
112+
113+
// Prevent garbage collection of session substitute before end of test, since the Linq query provider
114+
// only has a weak reference on it.
115+
Assert.That(session, Is.Not.Null);
104116
}
105117

106118
[Test]
@@ -133,6 +145,10 @@ public async Task DoNotContaminateQueryWithOptionsAsync()
133145
query.Received(1).SetCacheMode(CacheMode.Normal);
134146
query.Received(1).SetCacheRegion("testregion");
135147
query.Received(1).SetTimeout(10);
148+
149+
// Prevent garbage collection of session substitute before end of test, since the Linq query provider
150+
// only has a weak reference on it.
151+
Assert.That(session, Is.Not.Null);
136152
}
137153
}
138154
}

0 commit comments

Comments
 (0)