Skip to content

Commit a15766a

Browse files
Merge pull request #670 from johelvisguzman/GH-669
Gh 669
2 parents e0384c5 + 87e6e18 commit a15766a

File tree

11 files changed

+37
-39
lines changed

11 files changed

+37
-39
lines changed

benchmarks/DotNetToolkit.Repository.Performance/Benchmarks/BenchmarkBase.cs

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,31 @@
33
using System;
44
using System.Collections.Generic;
55
using System.Configuration;
6-
7-
#if NETFULL
8-
using System.Data.SqlClient;
9-
#endif
106
using BenchmarkDotNet.Attributes;
117
using Configuration.Options;
128
using Data;
9+
using InMemory;
1310
#if NETFULL
11+
using System.Data.SqlClient;
1412
using EntityFramework;
15-
#endif
13+
#else
14+
using AzureStorageBlob;
1615
using EntityFrameworkCore;
17-
using InMemory;
1816
using Microsoft.EntityFrameworkCore;
19-
#if NETCORE
20-
using AzureStorageBlob;
2117
#endif
2218

2319
public abstract class BenchmarkBase
2420
{
2521
#if NETFULL
2622
private SqlConnection _connection;
2723
#endif
28-
public static string ConnectionString { get; } = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
24+
public static string ConnectionString { get; } = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
2925

3026
protected void BaseSetup()
3127
{
3228
#if NETFULL
3329
_connection = new SqlConnection(ConnectionString);
34-
_connection.Open();
30+
_connection.Open();
3531
#endif
3632
}
3733

@@ -46,19 +42,18 @@ protected IRepositoryOptions BuildOptions(ContextProviderType provider)
4642
builder.UseInMemoryDatabase(Guid.NewGuid().ToString());
4743
break;
4844
}
49-
case ContextProviderType.EntityFrameworkCore:
50-
{
51-
builder.UseEntityFrameworkCore<EfCoreDbContext>(x => x.UseSqlServer(ConnectionString));
52-
break;
53-
}
5445
#if NETFULL
5546
case ContextProviderType.EntityFramework:
5647
{
5748
builder.UseEntityFramework<EfDbContext>(_connection);
5849
break;
5950
}
60-
#endif
61-
#if NETCORE
51+
#else
52+
case ContextProviderType.EntityFrameworkCore:
53+
{
54+
builder.UseEntityFrameworkCore<EfCoreDbContext>(x => x.UseSqlServer(ConnectionString));
55+
break;
56+
}
6257
case ContextProviderType.AzureStorageBlob:
6358
{
6459
builder.UseAzureStorageBlob(
@@ -67,7 +62,7 @@ protected IRepositoryOptions BuildOptions(ContextProviderType provider)
6762
break;
6863
}
6964
#endif
70-
default:
65+
default:
7166
throw new ArgumentOutOfRangeException(nameof(provider));
7267
}
7368

@@ -78,12 +73,11 @@ public virtual IEnumerable<ContextProviderType> Providers()
7873
{
7974
return new[]
8075
{
76+
ContextProviderType.InMemory,
8177
#if NETFULL
8278
ContextProviderType.EntityFramework,
83-
#endif
84-
ContextProviderType.InMemory,
79+
#else
8580
ContextProviderType.EntityFrameworkCore,
86-
#if NETCORE
8781
ContextProviderType.AzureStorageBlob,
8882
#endif
8983
};

benchmarks/DotNetToolkit.Repository.Performance/Data/EfCoreDbContext.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ public class EfCoreDbContext : DbContext
66
{
77
public DbSet<Customer> Customers { get; set; }
88

9-
public EfCoreDbContext(DbContextOptions options) : base(options) { }
9+
public EfCoreDbContext(DbContextOptions options) : base(options)
10+
{
11+
Database.EnsureCreated();
12+
}
1013
}
1114
}

benchmarks/DotNetToolkit.Repository.Performance/DotNetToolkit.Repository.Performance.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,17 @@
3131
</PropertyGroup>
3232

3333
<ItemGroup>
34-
<PackageReference Include="BenchmarkDotNet" Version="0.13.0" />
35-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.2" />
34+
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
3635
</ItemGroup>
3736

3837
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
3938
<PackageReference Include="EntityFramework.SqlServerCompact" Version="6.4.4" />
4039
<Reference Include="System.Configuration" />
4140
</ItemGroup>
41+
42+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
43+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.11" />
44+
</ItemGroup>
4245

4346
<ItemGroup>
4447
<ProjectReference Include="..\..\src\DotNetToolkit.Repository.EntityFrameworkCore\DotNetToolkit.Repository.EntityFrameworkCore.csproj" />

src/DotNetToolkit.Repository.AzureStorageBlob/DotNetToolkit.Repository.AzureStorageBlob.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Azure.Storage.Blobs" Version="12.9.1" />
13+
<PackageReference Include="Azure.Storage.Blobs" Version="12.10.0" />
1414
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
1515
<PackageReference Include="System.Linq.Async" Version="5.0.0" />
1616
</ItemGroup>

src/DotNetToolkit.Repository.Caching.Couchbase/DotNetToolkit.Repository.Caching.Couchbase.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="CouchbaseNetClient" Version="2.7.16" />
17+
<PackageReference Include="CouchbaseNetClient" Version="2.7.26" />
1818
</ItemGroup>
1919

2020
<ItemGroup>

src/DotNetToolkit.Repository.Caching.Redis/DotNetToolkit.Repository.Caching.Redis.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="StackExchange.Redis" Version="2.2.62" />
13+
<PackageReference Include="StackExchange.Redis" Version="2.2.79" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

src/DotNetToolkit.Repository.EntityFrameworkCore/DotNetToolkit.Repository.EntityFrameworkCore.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
</ItemGroup>
2121

2222
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
23-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.7" />
24-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.7" />
23+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.11" />
24+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.11" />
2525
</ItemGroup>
2626

2727
<ItemGroup>

src/DotNetToolkit.Repository.Extensions.Microsoft.DependencyInjection/DotNetToolkit.Repository.Extensions.Microsoft.DependencyInjection.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
13+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.2" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

src/DotNetToolkit.Repository/DotNetToolkit.Repository.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
3939
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" />
40-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
40+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
4141
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
4242
</ItemGroup>
4343

test/DotNetToolkit.Repository.Integration.Test/DotNetToolkit.Repository.Integration.Test.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@
3030

3131
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
3232
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.2" />
33-
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.7" />
33+
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.11" />
3434
</ItemGroup>
3535

3636
<ItemGroup>
37-
<PackageReference Include="CouchbaseNetClient" Version="2.7.16" />
3837
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
39-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
38+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
4039
<PackageReference Include="Moq" Version="4.16.1" />
4140
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
4241
<PackageReference Include="xunit" Version="2.4.1" />

0 commit comments

Comments
 (0)