using Mapster; using Microsoft.AspNetCore.Http; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using Roadie.Library; using Roadie.Library.Caching; using Roadie.Library.Configuration; using Roadie.Library.Data.Context; using Roadie.Library.Encoding; using Roadie.Library.Enums; using Roadie.Library.Extensions; using Roadie.Library.Imaging; using Roadie.Library.Models; using Roadie.Library.Models.Pagination; using Roadie.Library.Models.Statistics; using Roadie.Library.Models.Users; using Roadie.Library.Utility; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Linq.Dynamic.Core; using System.Net.Http; using System.Threading.Tasks; using data = Roadie.Library.Data; namespace Roadie.Api.Services { public class LabelService : HttpFactoryServiceBase, ILabelService { private IBookmarkService BookmarkService { get; } public LabelService(IRoadieSettings configuration, IHttpEncoder httpEncoder, IHttpContext httpContext, IRoadieDbContext context, ICacheManager cacheManager, ILogger logger, IBookmarkService bookmarkService, IHttpClientFactory httpClientFactory) : base(configuration, httpEncoder, context, cacheManager, logger, httpContext, httpClientFactory) { BookmarkService = bookmarkService; } private async Task> LabelByIdAction(Guid id, IEnumerable includes = null) { var timings = new Dictionary(); var tsw = new Stopwatch(); var sw = Stopwatch.StartNew(); sw.Start(); tsw.Restart(); var label = await GetLabel(id).ConfigureAwait(false); tsw.Stop(); timings.Add(nameof(GetLabel), tsw.ElapsedMilliseconds); if (label == null) { return new OperationResult