Ejemplo n.º 1
0
        protected virtual async Task ApplyEntityRuleAsync(IEntity entity)
        {
            Type entityType = ProxyHelper.GetUnProxiedType(entity);
            // 加载规则列表
            var groups = await RuleFinder.GetRuleGroupsAsync(entityType);

            if (groups.Any())
            {
                // 应用规则
                await EntityRuleContributor.ApplyAsync(new EntityRuleContext(groups, entity));
            }
        }