protected override async Task <DateTimeOffset> GetLatestByServiceAndContainerNamesImplementation(
            GetLatestByServiceAndContainerNamesRequest request,
            CancellationToken cancellation)
        {
            await using var connection = _connectionFactory.CreateConnection();

            var command = new CommandDefinition(
                GetLastLogEntryDateForAppServiceAndContainer(),
                new { request.ServiceName, request.ContainerName },
                cancellationToken: cancellation);

            var lastDate = await connection.QueryFirstOrDefaultAsync <DateTimeOffset>(command);

            return(lastDate);
        }
        protected override async Task <DateTimeOffset> GetLatestByServiceAndContainerNamesImplementation(
            GetLatestByServiceAndContainerNamesRequest request,
            CancellationToken cancellation)
        {
            var collection = await _collectionFactory.Get <LogEntry>(cancellation);

            var filter =
                Builders <LogEntry> .Filter.Where(x =>
                                                  x.ServiceName == request.ServiceName &&
                                                  x.ContainerName == request.ContainerName);

            var cursor = await collection.FindAsync(filter, GetFindOptions.Value, cancellation);

            var entry = await cursor.FirstOrDefaultAsync(cancellation);

            return(entry == null ? default : entry.EventDate);
        }