Skip to content

No caching used in SiteService.GetAllAsync #2080

@adrian-crisan625

Description

@adrian-crisan625

While investigating some performance issues, we noticed that the call to SiteService.GetAllAsync does not cache the result at all. The rest of methods that get data from SiteService (ex. GetByIdAsync) use the cache for the results.
Is there any reason why SiteService.GetAllAsync does not use cache? Or is it an oversight?

public async Task<IEnumerable> GetAllAsync()
{
var models = await _repo.GetAll();

if (models.Count() > 0)
{
    foreach (var model in models)
    {
        if (model.Logo != null && model.Logo.Id.HasValue)
        {
            await _factory.InitFieldAsync(model.Logo);
        }
    }
}
return models;

}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions