示例#1
0
        public async Task AddTagToEntityAsync(EntityTagCreateDto input)
        {
            var definition = await _tagDefinitionStore.GetTagEntityTypeDefinitionsAsync(input.EntityType);

            await CheckPolicyAsync(definition.CreatePolicy);

            var tag = await _tagManager.GetOrAddAsync(input.EntityType, input.TagName, CurrentTenant?.Id);

            await _entityTagManager.AddTagToEntityAsync(
                tag.Id,
                input.EntityType,
                input.EntityId,
                CurrentTenant?.Id);
        }
示例#2
0
        public virtual async Task AddTagToEntityAsync(EntityTagCreateDto input)
        {
            var definition = await TagDefinitionStore.GetTagEntityTypeDefinitionAsync(input.EntityType);

            await CheckAnyOfPoliciesAsync(definition.CreatePolicies);

            var tag = await TagManager.GetOrAddAsync(input.EntityType, input.TagName);

            await EntityTagManager.AddTagToEntityAsync(
                tag.Id,
                input.EntityType,
                input.EntityId,
                CurrentTenant?.Id);
        }
示例#3
0
 public Task AddTagToEntityAsync(EntityTagCreateDto input)
 {
     return(EntityTagAdminAppService.AddTagToEntityAsync(input));
 }