excise entity framework from all remaining code

This commit is contained in:
sam 2024-10-28 14:04:55 +01:00
parent d6c3133d52
commit ff92c5f335
Signed by: sam
GPG key ID: 5F3C3C1B3166639D
62 changed files with 402 additions and 1339 deletions

View file

@ -13,8 +13,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
using Catalogger.Backend.Database.Dapper.Repositories;
using Catalogger.Backend.Database.Queries;
using Catalogger.Backend.Database.Repositories;
namespace Catalogger.Backend.Services;

View file

@ -19,7 +19,6 @@ using Catalogger.Backend.Cache;
using Humanizer;
using Remora.Discord.API.Abstractions.Rest;
using Remora.Discord.API.Gateway.Commands;
using Remora.Discord.Gateway;
using Remora.Rest.Core;
namespace Catalogger.Backend.Services;

View file

@ -16,10 +16,8 @@
using System.Diagnostics;
using Catalogger.Backend.Cache.InMemoryCache;
using Catalogger.Backend.Database;
using Catalogger.Backend.Database.Dapper;
using Dapper;
using Humanizer;
using Microsoft.EntityFrameworkCore;
using Prometheus;
namespace Catalogger.Backend.Services;
@ -40,7 +38,6 @@ public class MetricsCollectionService(
var timer = CataloggerMetrics.MetricsCollectionTime.NewTimer();
await using var scope = services.CreateAsyncScope();
await using var db = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
await using var conn = scope.ServiceProvider.GetRequiredService<DatabaseConnection>();
var messageCount = await conn.ExecuteScalarAsync<int>("select count(id) from messages");

View file

@ -18,10 +18,10 @@ using System.Diagnostics.CodeAnalysis;
using Catalogger.Backend.Cache;
using Catalogger.Backend.Cache.InMemoryCache;
using Catalogger.Backend.Extensions;
using OneOf;
using Remora.Discord.API;
using Remora.Discord.API.Abstractions.Objects;
using Remora.Discord.API.Abstractions.Rest;
using Remora.Discord.API.Objects;
using Remora.Rest.Core;
using Guild = Catalogger.Backend.Database.Models.Guild;
@ -109,7 +109,7 @@ public class WebhookExecutorService(
}
var attachments = files
.Select<FileData, OneOf.OneOf<FileData, IPartialAttachment>>(f => f)
.Select<FileData, OneOf<FileData, IPartialAttachment>>(f => f)
.ToList();
if (embeds.Count == 0 && attachments.Count == 0)