fix: 标签跳转失败的问题
This commit is contained in:
16
YaeBlog.Core/Models/EssayTag.cs
Normal file
16
YaeBlog.Core/Models/EssayTag.cs
Normal 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();
|
||||
}
|
Reference in New Issue
Block a user