Exemplo n.º 1
0
    public async Task RemoveTagFromEntityAsync_ShouldRemove_WhenEverythingCorrect()
    {
        var tagToDelete = (await _tagRepository.GetAllRelatedTagsAsync(_cmsKitTestData.EntityType1, _cmsKitTestData.EntityId1))
                          .First();

        await _entityTagManager.RemoveTagFromEntityAsync(tagToDelete.Id, tagToDelete.EntityType, _cmsKitTestData.EntityId1);

        var tags = await _tagRepository.GetAllRelatedTagsAsync(_cmsKitTestData.EntityType1, _cmsKitTestData.EntityId1);

        tags.ShouldNotContain(x => x.Id == tagToDelete.Id);
    }
Exemplo n.º 2
0
        public virtual async Task RemoveTagFromEntityAsync(EntityTagRemoveDto input)
        {
            var definition = await TagDefinitionStore.GetTagEntityTypeDefinitionAsync(input.EntityType);

            await CheckPolicyAsync(definition.DeletePolicy);

            await EntityTagManager.RemoveTagFromEntityAsync(
                input.TagId,
                input.EntityType,
                input.EntityId,
                CurrentTenant?.Id);
        }