mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-21 20:17:22 +01:00
Remove Z.EntityFramework.Plus
Switch to using `RelationalQueryableExtensions.ExecuteDeleteAsync` for async deletes
This commit is contained in:
@@ -11,8 +11,6 @@ using Tgstation.Server.Host.Database;
|
||||
using Tgstation.Server.Host.Models;
|
||||
using Tgstation.Server.Host.System;
|
||||
|
||||
using Z.EntityFramework.Plus;
|
||||
|
||||
namespace Tgstation.Server.Host.Components.Session
|
||||
{
|
||||
/// <inheritdoc />
|
||||
@@ -221,7 +219,7 @@ namespace Tgstation.Server.Host.Components.Session
|
||||
.ReattachInformations
|
||||
.AsQueryable()
|
||||
.Where(x => x.Id == result.Id)
|
||||
.DeleteAsync(cancellationToken);
|
||||
.ExecuteDeleteAsync(cancellationToken);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
@@ -271,7 +269,7 @@ namespace Tgstation.Server.Host.Components.Session
|
||||
|
||||
if (instant)
|
||||
await baseQuery
|
||||
.DeleteAsync(cancellationToken);
|
||||
.ExecuteDeleteAsync(cancellationToken);
|
||||
else
|
||||
{
|
||||
var results = await baseQuery.ToListAsync(cancellationToken);
|
||||
|
||||
@@ -26,8 +26,6 @@ using Tgstation.Server.Host.Models;
|
||||
using Tgstation.Server.Host.Security;
|
||||
using Tgstation.Server.Host.Utils;
|
||||
|
||||
using Z.EntityFramework.Plus;
|
||||
|
||||
namespace Tgstation.Server.Host.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
@@ -189,7 +187,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
.ChatBots
|
||||
.AsQueryable()
|
||||
.Where(x => x.Id == id)
|
||||
.DeleteAsync(cancellationToken));
|
||||
.ExecuteDeleteAsync(cancellationToken));
|
||||
return null;
|
||||
})
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@ using Tgstation.Server.Host.Models;
|
||||
using Tgstation.Server.Host.Security;
|
||||
using Tgstation.Server.Host.Utils;
|
||||
|
||||
using Z.EntityFramework.Plus;
|
||||
|
||||
namespace Tgstation.Server.Host.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
@@ -259,7 +257,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
.Where(x => x.Id == Instance.Id)
|
||||
.SelectMany(x => x.InstancePermissionSets)
|
||||
.Where(x => x.PermissionSetId == id)
|
||||
.DeleteAsync(cancellationToken);
|
||||
.ExecuteDeleteAsync(cancellationToken);
|
||||
|
||||
return numDeleted > 0 ? NoContent() : this.Gone();
|
||||
}
|
||||
|
||||
@@ -21,8 +21,6 @@ using Tgstation.Server.Host.Models;
|
||||
using Tgstation.Server.Host.Security;
|
||||
using Tgstation.Server.Host.Utils;
|
||||
|
||||
using Z.EntityFramework.Plus;
|
||||
|
||||
namespace Tgstation.Server.Host.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
@@ -221,7 +219,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
.Groups
|
||||
.AsQueryable()
|
||||
.Where(x => x.Id == id && x.Users!.Count == 0)
|
||||
.DeleteAsync(cancellationToken);
|
||||
.ExecuteDeleteAsync(cancellationToken);
|
||||
|
||||
if (numDeleted > 0)
|
||||
return NoContent();
|
||||
|
||||
@@ -14,8 +14,6 @@ using Tgstation.Server.Host.Models;
|
||||
using Tgstation.Server.Host.Security;
|
||||
using Tgstation.Server.Host.System;
|
||||
|
||||
using Z.EntityFramework.Plus;
|
||||
|
||||
namespace Tgstation.Server.Host.Database
|
||||
{
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -124,8 +124,6 @@
|
||||
<PackageReference Include="System.Management" Version="8.0.0" />
|
||||
<!-- Usage: Temporary resolution to compatibility issues with EFCore 7 and .NET 8 -->
|
||||
<PackageReference Include="System.Security.Permissions" Version="8.0.0" />
|
||||
<!-- Usage: .DeleteAsync() support for IQueryable<T>s -->
|
||||
<PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="8.103.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user