增加文章栏目伪静态规则1

This commit is contained in:
comm5v8
2019-05-25 17:26:40 +08:00
parent 34fdb431d4
commit 993de032b9
9 changed files with 206 additions and 34 deletions
+16
View File
@@ -132,6 +132,22 @@ namespace COMCMS.Core
return Find(_.Id == id);
}
/// <summary>根据目录查找</summary>
/// <param name="path">目录</param>
/// <returns>实体对象</returns>
public static Category FindByFilePath(string path)
{
if (string.IsNullOrEmpty(path)) return null;
// 实体缓存
if (Meta.Count < 1000) return Meta.Cache.Find(e => e.FilePath == path);
// 单对象缓存
//return Meta.SingleCache[id];
return Find(_.FilePath == path);
}
/// <summary>
/// 根据父ID查询所有子项
/// </summary>