Ejemplo n.º 1
0
    public async Task <int> AddContentAsync(
        Content content,
        CancellationToken cancellationToken = default)
    {
        content.Id = await ContentRepository.AddContentAsync(
            content, cancellationToken);

        await DistributedCache.SetAsync(
            $"{CacheKeyPrefix}{content.Path}",
            content,
            DistributedCacheEntryOptions,
            JsonSerializerOptions,
            cancellationToken);

        return(content.Id);
    }