Skip to content

Commit 5c89853

Browse files
committed
chore: Upgrade package
1 parent eb3c0b5 commit 5c89853

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

Directory.Packages.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.10" />
1414
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="9.0.0-rc.2.24474.3" />
1515
<PackageVersion Include="MongoDB.Driver" Version="2.30.0" />
16-
<PackageVersion Include="MySql.EntityFrameworkCore" Version="8.0.8" />
16+
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />
1717
<PackageVersion Include="RavenDB.Client" Version="6.2.1" />
1818
</ItemGroup>
1919
<ItemGroup Label="Web">
@@ -38,7 +38,7 @@
3838
<PackageVersion Include="bunit.generators" Version="2.0.24-preview" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
3939
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
4040
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
41-
<PackageVersion Include="xunit.v3" Version="0.5.0-pre.27" />
42-
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.0-pre.42" />
41+
<PackageVersion Include="xunit.v3" Version="0.6.0-pre.7" />
42+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.0-pre.49" />
4343
</ItemGroup>
4444
</Project>

src/LinkDotNet.Blog.Infrastructure/Persistence/Sql/Mapping/BlogPostConfiguration.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ namespace LinkDotNet.Blog.Infrastructure.Persistence.Sql.Mapping;
1010

1111
internal sealed class BlogPostConfiguration : IEntityTypeConfiguration<BlogPost>
1212
{
13-
private readonly DatabaseFacade databaseFacade;
13+
private readonly DatabaseFacade database;
1414

15-
public BlogPostConfiguration(DatabaseFacade databaseFacade)
16-
=> this.databaseFacade = databaseFacade;
15+
public BlogPostConfiguration(DatabaseFacade database)
16+
=> this.database = database;
1717

1818
public void Configure(EntityTypeBuilder<BlogPost> builder)
1919
{
@@ -31,10 +31,10 @@ public void Configure(EntityTypeBuilder<BlogPost> builder)
3131

3232
var tags = builder.Property(x => x.Tags).HasMaxLength(2048);
3333

34-
if (databaseFacade.IsMySql())
34+
if (database.IsMySql())
3535
{
3636
// MySQL EF Driver does not support arrays out of the box so we have to json serialize and deserialize them
37-
tags.HasConversion<JsonArrayConverter>();
37+
// tags.HasColumnType("json");
3838
}
3939

4040
builder.HasIndex(x => new { x.IsPublished, x.UpdatedDate })

src/LinkDotNet.Blog.Web/LinkDotNet.Blog.Web.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" />
1717
<PackageReference Include="Microsoft.Extensions.Options" />
1818
<PackageReference Include="System.ServiceModel.Syndication" />
19+
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" />
1920
</ItemGroup>
2021

2122
<ItemGroup>

src/LinkDotNet.Blog.Web/RegistrationExtensions/SqlRegistrationExtensions.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ public static void UseMySqlAsStorageProvider(this IServiceCollection services)
5454
{
5555
var configuration = s.GetRequiredService<IOptions<ApplicationConfiguration>>();
5656
var connectionString = configuration.Value.ConnectionString;
57-
builder.UseMySQL(connectionString)
57+
builder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString), mySqlOptions =>
58+
{
59+
mySqlOptions.EnablePrimitiveCollectionsSupport();
60+
})
5861
#if DEBUG
5962
.EnableDetailedErrors()
6063
#endif

0 commit comments

Comments
 (0)