From ea5ab42152fb8edf6135c9860778ee420ab51fae Mon Sep 17 00:00:00 2001 From: guotianliang <1265346495@qq.com> Date: Wed, 1 Mar 2023 14:35:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=96=87=E4=BB=B6=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index c00179c..54bcbb8 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,31 @@ Configure(options => `config.SetAliasAndTitle("活动项", contestItem => contestItem.ContestItemName)` +#### 文件统计策略 + +目前实体中包含文件提供了两种策略进行统计。 + +- `RichTextStatisticsStrategy` 富文本统计策略,用于文件信息存储在`string`类型的属性中。 + +- `EntityHasFileIdStatisticsStrategy` 实体存储了所用文件的 Id。需要配合 `IHasFileIdObject` 接口一起使用(~~或者实体属性中包含`FileId`查找,未实现~~)。 + +使用`AddHasUploadContentEntity` 默认配置是 `RichTextStatisticsStrategy`,可通过泛型方式使用其他策略,如下所示: + +```csharp +Configure(options => +{ + options.AddEntityConfig(config => + config.Root("二次备课", design => design.Name)); + + options.AddHasUploadContentEntity(config => + config.Parent(bkFile => bkFile.BeiKeId)); +}); +``` + +#### 多主键实体 + +比如上面策略的代码中 `BeiKeFile` 实体是多主键的。该实体多个主键必须都是`Guid`类型的,否则在查找实体时,则会异常。 + # 投票 ## 代码结构