You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ScratchDatabaseFixture.cs 623 B

8 years ago
8 years ago
8 years ago
12345678910111213141516171819202122
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Internal;
  3. namespace Cap.Consistency.EntityFrameworkCore.Test
  4. {
  5. public class ScratchDatabaseFixture : IDisposable
  6. {
  7. private LazyRef<SqlServerTestStore> _testStore;
  8. public ScratchDatabaseFixture() {
  9. _testStore = new LazyRef<SqlServerTestStore>(() => SqlServerTestStore.CreateScratch());
  10. }
  11. public string ConnectionString => _testStore.Value.Connection.ConnectionString;
  12. public void Dispose() {
  13. if (_testStore.HasValue) {
  14. _testStore.Value?.Dispose();
  15. }
  16. }
  17. }
  18. }