mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
rollback ef core due to dual-key sort query breaking
This commit is contained in:
parent
f6a84ed6c0
commit
814ff22568
5 changed files with 6 additions and 10 deletions
|
|
@ -21,11 +21,11 @@
|
|||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.DotNet.Analyzers.Compatibility" Version="0.2.12-alpha" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.0">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.6">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.1.0" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.6" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -102,7 +102,7 @@ private static async Task InsertOnDuplicateKeyUpdate<TEntity>(DbContext dbContex
|
|||
return;
|
||||
var columns = string.Join(", ", properties.Select(x => x.Name));
|
||||
var updates = CreateUpdates(properties);
|
||||
var sql = "INSERT INTO " + entityType.GetTableName() + " (" + columns + ") VALUES " + values +
|
||||
var sql = "INSERT INTO " + entityType.Relational().TableName + " (" + columns + ") VALUES " + values +
|
||||
" ON DUPLICATE KEY UPDATE " + updates;
|
||||
await dbContext.Database.ExecuteSqlCommandAsync(sql);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,9 +12,6 @@
|
|||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using Pomelo.EntityFrameworkCore.MySql.Infrastructure;
|
||||
using Pomelo.EntityFrameworkCore.MySql.Storage;
|
||||
using System;
|
||||
|
||||
namespace FilterLists.Services.DependencyInjection.Extensions
|
||||
{
|
||||
|
|
@ -25,8 +22,7 @@ public static void AddFilterListsApiServices(this IServiceCollection services, I
|
|||
services.AddSingleton(c => config);
|
||||
services.AddDbContextPool<FilterListsDbContext>(o =>
|
||||
o.UseMySql(config.GetConnectionString("FilterListsConnection"),
|
||||
m => m.MigrationsAssembly("FilterLists.Api")
|
||||
.ServerVersion(new ServerVersion(new Version(10, 4, 12), ServerType.MariaDb))));
|
||||
m => m.MigrationsAssembly("FilterLists.Api")));
|
||||
services.TryAddScoped<FilterListService>();
|
||||
services.TryAddScoped<LanguageService>();
|
||||
services.TryAddScoped<LicenseService>();
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.0">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.6">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.0">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.6">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
|
|
|||
Loading…
Reference in a new issue