YaeBlog/YaeBlog/Models/EssayTag.cs
jackfiled 3aae468e65
All checks were successful
Build blog docker image / Build-Blog-Image (push) Successful in 1m15s
feat: 从Bootstrap迁移到Tailwind css (#9)
Reviewed-on: #9
2025-01-24 16:46:56 +08:00

17 lines
501 B
C#

using System.Text.Encodings.Web;
namespace YaeBlog.Models;
public class EssayTag(string tagName) : IEquatable<EssayTag>
{
public string TagName { get; } = tagName;
public string UrlEncodedTagName { get; } = UrlEncoder.Default.Encode(tagName);
public bool Equals(EssayTag? other) => other is not null && TagName == other.TagName;
public override bool Equals(object? obj) => obj is EssayTag other && Equals(other);
public override int GetHashCode() => TagName.GetHashCode();
}