oliverbooth.dev/OliverBooth/Data/Blog/LegacyComment.cs
Oliver Booth 6ec4103a3a
refactor: separate Markdig extensions from project
Also introduces .Common project to house common references and types
2024-05-05 02:18:20 +01:00

35 lines
845 B
C#

using System.Web;
using OliverBooth.Common.Data.Blog;
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)}";
}
}