Change and Delete messages
This commit is contained in:
@@ -28,46 +28,6 @@ public class GetContentsByCreatorHandler(
|
||||
GetContentsByCreatorRequest req,
|
||||
CancellationToken ct)
|
||||
{
|
||||
// var queryBuilder = new StringBuilder();
|
||||
// queryBuilder.AppendLine($"""
|
||||
// SELECT content."Id",
|
||||
// content."CreatedBy",
|
||||
// creator."Name" as CreatedByName,
|
||||
// i."Logo" as CreatedByPortraitUrl,
|
||||
// c."Menu" as ColorMenu,
|
||||
// c."Accent" as ColorAccent,
|
||||
// content."CreatedAt",
|
||||
// content."DeletedBy",
|
||||
// content."DeletedAt",
|
||||
// content."Title",
|
||||
// content."Description",
|
||||
// content."Urls",
|
||||
// FROM "Content"."Contents" AS content
|
||||
// INNER JOIN "Content"."Creators" AS creator ON content."CreatedBy" = creator."Id"
|
||||
// LEFT JOIN "Content"."Images" AS i ON creator."Id" = i."CreatorId"
|
||||
// LEFT JOIN "Content"."Colors" AS c ON creator."Id" = c."CreatorId"
|
||||
// WHERE content."CreatedBy" = '{req.CreatorId}'
|
||||
// AND content."DeletedBy" IS NULL
|
||||
// """);
|
||||
//
|
||||
// if (req.LastId.HasValue)
|
||||
// {
|
||||
// queryBuilder.AppendLine($"""AND content."Id" > '{req.LastId.Value}'""");
|
||||
// }
|
||||
//
|
||||
// queryBuilder.AppendLine($"""
|
||||
// ORDER BY content."CreatedAt" DESC
|
||||
// LIMIT {req.PageSize}
|
||||
// """);
|
||||
//
|
||||
// var query = queryBuilder.ToString();
|
||||
//
|
||||
// var results = await context
|
||||
// .Database
|
||||
// .SqlQueryRaw<ContentModel>(query)
|
||||
// .ToListAsync(cancellationToken: ct);
|
||||
|
||||
|
||||
var query = context.Contents
|
||||
.Where(c => c.CreatedBy == req.CreatorId && c.DeletedAt == null)
|
||||
.OrderByDescending(c => c.CreatedAt);
|
||||
|
||||
Reference in New Issue
Block a user