public async Task <BackgroundTask> GetByIdAsync(int id)
        {
            var task = await _repository.RetrieveSingleOrDefaultAsync(x => x.TaskId == id);

            // ReSharper disable once UseNullPropagation (implicit conversion will fail)
            // ReSharper disable once ConvertIfStatementToReturnStatement (implicit conversion will fail)
            if (task == null)
            {
                return(null);
            }
            return(task);
        }