Skip to content

Commit d9d5f5f

Browse files
authored
only support Microsoft.Data.SqlClient (#414)
1 parent dd42c3e commit d9d5f5f

30 files changed

Lines changed: 100 additions & 104 deletions

pages/directory-and-name-resolution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public Task<SqlDatabase> Build(
114114
string? databaseSuffix = null,
115115
[CallerMemberName] string memberName = "")
116116
```
117-
<sup><a href='/src/LocalDb/SqlInstance.cs#L56-L76' title='Snippet source file'>snippet source</a> | <a href='#snippet-conventionbuildsignature' title='Start of snippet'>anchor</a></sup>
117+
<sup><a href='/src/LocalDb/SqlInstance.cs#L55-L75' title='Snippet source file'>snippet source</a> | <a href='#snippet-conventionbuildsignature' title='Start of snippet'>anchor</a></sup>
118118
<!-- endSnippet -->
119119

120120
With these parameters the database name is the derived as follows:
@@ -150,7 +150,7 @@ If full control over the database name is required, there is an overload that ta
150150
/// </summary>
151151
public async Task<SqlDatabase> Build(string dbName)
152152
```
153-
<sup><a href='/src/LocalDb/SqlInstance.cs#L89-L94' title='Snippet source file'>snippet source</a> | <a href='#snippet-explicitbuildsignature' title='Start of snippet'>anchor</a></sup>
153+
<sup><a href='/src/LocalDb/SqlInstance.cs#L88-L93' title='Snippet source file'>snippet source</a> | <a href='#snippet-explicitbuildsignature' title='Start of snippet'>anchor</a></sup>
154154
<!-- endSnippet -->
155155

156156
Which can be used as follows:

pages/ef-classic-usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ The snippets use a DbContext of the following form:
2222
<!-- snippet: EfClassicLocalDb.Tests/Snippets/TheDbContext.cs -->
2323
<a id='snippet-EfClassicLocalDb.Tests/Snippets/TheDbContext.cs'></a>
2424
```cs
25-
using System.Data.Common;
2625
using System.Data.Entity;
26+
using Microsoft.Data.SqlClient;
2727

2828
public class TheDbContext :
2929
DbContext
3030
{
3131
public DbSet<TheEntity> TestEntities { get; set; } = null!;
3232

33-
public TheDbContext(DbConnection connection) :
33+
public TheDbContext(SqlConnection connection) :
3434
base(connection, false)
3535
{
3636
}

pages/raw-usage.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ The snippets use the following helper class:
2222
<!-- snippet: TestDbBuilder.cs -->
2323
<a id='snippet-TestDbBuilder.cs'></a>
2424
```cs
25-
using System.Data.Common;
25+
using Microsoft.Data.SqlClient;
2626

2727
public static class TestDbBuilder
2828
{
29-
public static async Task CreateTable(DbConnection connection)
29+
public static async Task CreateTable(SqlConnection connection)
3030
{
3131
await using var command = connection.CreateCommand();
3232
command.CommandText = "create table MyTable (Value int);";
@@ -35,7 +35,7 @@ public static class TestDbBuilder
3535

3636
static int intData = 0;
3737

38-
public static async Task<int> AddData(DbConnection connection)
38+
public static async Task<int> AddData(SqlConnection connection)
3939
{
4040
await using var command = connection.CreateCommand();
4141
var addData = intData;
@@ -47,7 +47,7 @@ values ({addData});";
4747
return addData;
4848
}
4949

50-
public static async Task<List<int>> GetData(DbConnection connection)
50+
public static async Task<List<int>> GetData(SqlConnection connection)
5151
{
5252
List<int> values = new();
5353
await using var command = connection.CreateCommand();

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project>
33
<PropertyGroup>
44
<NoWarn>CS1591;CA1416;CS8632</NoWarn>
5-
<Version>11.0.0</Version>
5+
<Version>12.0.0</Version>
66
<AssemblyVersion>1.0.0</AssemblyVersion>
77
<ContinuousIntegrationBuild>false</ContinuousIntegrationBuild>
88
</PropertyGroup>

src/EfClassicLocalDb.Tests/Contexts/DuplicateDbContext.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using System.Data.Common;
2-
using System.Data.Entity;
1+
using System.Data.Entity;
2+
using Microsoft.Data.SqlClient;
33

44
public class DuplicateDbContext :
55
DbContext
66
{
77
public DbSet<TestEntity> TestEntities { get; set; } = null!;
88

9-
public DuplicateDbContext(DbConnection connection) :
9+
public DuplicateDbContext(SqlConnection connection) :
1010
base(connection, false)
1111
{
1212
}

src/EfClassicLocalDb.Tests/Contexts/TestDbContext.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using System.Data.Common;
2-
using System.Data.Entity;
1+
using System.Data.Entity;
2+
using Microsoft.Data.SqlClient;
33

44
public class TestDbContext :
55
DbContext
66
{
77
public DbSet<TestEntity> TestEntities { get; set; } = null!;
88

9-
public TestDbContext(DbConnection connection) :
9+
public TestDbContext(SqlConnection connection) :
1010
base(connection, false)
1111
{
1212
}

src/EfClassicLocalDb.Tests/Contexts/WithRebuildDbContext.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using System.Data.Common;
2-
using System.Data.Entity;
1+
using System.Data.Entity;
2+
using Microsoft.Data.SqlClient;
33

44
public class WithRebuildDbContext :
55
DbContext
66
{
77
public DbSet<TestEntity> TestEntities { get; set; } = null!;
88

9-
public WithRebuildDbContext(DbConnection connection) :
9+
public WithRebuildDbContext(SqlConnection connection) :
1010
base(connection, false)
1111
{
1212

src/EfClassicLocalDb.Tests/EfClassicLocalDb.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
<PackageReference Include="EntityFramework" Version="6.4.4" />
1616
<PackageReference Include="XunitContext" Version="3.0.0" />
17+
<PackageReference Include="Microsoft.Data.SqlClient" Version="4.0.0" />
1718
<PackageReference Include="Verify.Xunit" Version="14.4.0" />
1819
<PackageReference Include="Xunit" Version="2.4.1" />
1920
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" PrivateAssets="all" />

src/EfClassicLocalDb.Tests/Snippets/BuildTemplateDbContext.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using System.Data.Common;
2-
using System.Data.Entity;
1+
using System.Data.Entity;
2+
using Microsoft.Data.SqlClient;
33

44
public class BuildTemplateDbContext :
55
DbContext
66
{
77
public DbSet<TheEntity> TestEntities { get; set; } = null!;
88

9-
public BuildTemplateDbContext(DbConnection connection) :
9+
public BuildTemplateDbContext(SqlConnection connection) :
1010
base(connection, false)
1111
{
1212
}

src/EfClassicLocalDb.Tests/Snippets/MyDbContext.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using System.Data.Common;
2-
using System.Data.Entity;
1+
using System.Data.Entity;
2+
using Microsoft.Data.SqlClient;
33

44
public class MyDbContext :
55
DbContext
66
{
77
public DbSet<TheEntity> TestEntities { get; set; } = null!;
88

9-
public MyDbContext(DbConnection connection) :
9+
public MyDbContext(SqlConnection connection) :
1010
base(connection, false)
1111
{
1212
}

0 commit comments

Comments
 (0)