Fix GetContentsByCreator ugly ef query
This commit is contained in:
@@ -1,27 +1,14 @@
|
||||
using Hutopy.Web.Features.Contents.Data;
|
||||
|
||||
namespace Hutopy.Web.Features.Contents.Handlers.Models;
|
||||
namespace Hutopy.Web.Features.Contents.Handlers.Models;
|
||||
|
||||
[PublicAPI]
|
||||
public record struct ContentModel(
|
||||
Guid Id,
|
||||
Guid CreatedBy,
|
||||
string CreatedByName,
|
||||
string? CreatedByPortraitUrl,
|
||||
DateTimeOffset CreatedAt,
|
||||
string Title,
|
||||
string Description,
|
||||
string[]? Urls);
|
||||
|
||||
public static class ContentExtensions
|
||||
public class ContentModel
|
||||
{
|
||||
public static ContentModel ToResponse(this Content c) => new(
|
||||
c.Id,
|
||||
c.CreatedBy,
|
||||
c.Creator!.Name,
|
||||
c.Creator.Images.Logo,
|
||||
c.CreatedAt,
|
||||
c.Title,
|
||||
c.Description,
|
||||
c.Urls);
|
||||
public Guid Id { get; set; }
|
||||
public Guid CreatedBy { get; set; }
|
||||
public string CreatedByName { get; set; }
|
||||
public string? CreatedByPortraitUrl { get; set; }
|
||||
public DateTimeOffset CreatedAt { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string[]? Urls { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user