fix: 标签跳转失败的问题

This commit is contained in:
2024-07-27 21:07:57 +08:00
parent 70e4c81d66
commit 131a966940
12 changed files with 119 additions and 60 deletions

View File

@@ -0,0 +1,16 @@
using System.Text.Encodings.Web;
namespace YaeBlog.Core.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();
}