oliverbooth.dev/OliverBooth/Data/Blog/LegacyComment.cs
Oliver Booth a7426b008b
feat: show legacy disqus comments beneath gisqus
No Disqus connection here. I just saved them to DB
2024-05-01 16:47:31 +01:00

34 lines
809 B
C#

using System.Web;
namespace OliverBooth.Data.Blog;
internal sealed class LegacyComment : ILegacyComment
{
/// <inheritdoc />
public string? Avatar { get; private set; }
/// <inheritdoc />
public string Author { get; private set; } = string.Empty;
/// <inheritdoc />
public string Body { get; private set; } = string.Empty;
/// <inheritdoc />
public DateTimeOffset CreatedAt { get; private set; }
/// <inheritdoc />
public Guid Id { get; private set; }
/// <inheritdoc />
public Guid? ParentComment { get; private set; }
/// <inheritdoc />
public Guid PostId { get; private set; }
/// <inheritdoc />
public string GetAvatarUrl()
{
return Avatar ?? $"https://ui-avatars.com/api/?name={HttpUtility.UrlEncode(Author)}";
}
}