From f0c8702f7ed6685f0fa8311f86eb68427b74ce13 Mon Sep 17 00:00:00 2001 From: Arthur Vickers Date: Sun, 21 Apr 2019 15:02:12 -0700 Subject: [PATCH] Remove use of LazyRef Fixes #9172 Needed to stop https://github.com/aspnet/EntityFrameworkCore/pull/15434 from breaking ASP.NET Core build. --- .../test/EF.Test/Utilities/ScratchDatabaseFixture.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Identity/EntityFrameworkCore/test/EF.Test/Utilities/ScratchDatabaseFixture.cs b/src/Identity/EntityFrameworkCore/test/EF.Test/Utilities/ScratchDatabaseFixture.cs index 510131246f..195e3d3466 100644 --- a/src/Identity/EntityFrameworkCore/test/EF.Test/Utilities/ScratchDatabaseFixture.cs +++ b/src/Identity/EntityFrameworkCore/test/EF.Test/Utilities/ScratchDatabaseFixture.cs @@ -9,12 +9,11 @@ namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test { public class ScratchDatabaseFixture : IDisposable { -#pragma warning disable EF1001 // Internal EF Core API usage. - private readonly LazyRef _testStore; + private readonly Lazy _testStore; public ScratchDatabaseFixture() { - _testStore = new LazyRef(() => SqlServerTestStore.CreateScratch()); + _testStore = new Lazy(() => SqlServerTestStore.CreateScratch()); } public string ConnectionString => _testStore.Value.Connection.ConnectionString; @@ -23,9 +22,8 @@ namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test { if (_testStore.HasValue) { - _testStore.Value?.Dispose(); + _testStore.Value.Dispose(); } } -#pragma warning restore EF1001 // Internal EF Core API usage. } }