Anonymous functions, delegates and lambda expressions aren't supported in job method parameters

I’m using Hangfire for first time on a .Net Core Application… I’ve wrote a Job like this:

using MyTask.Data;
using MyTask.Models;

namespace MyTask
{
public class CandleStickJob
{
private readonly ILogger _logger;
private readonly CandleStickDbContext _context;

    public CandleStickJob(ILogger<CandleStickJob> logger, CandleStickDbContext context)
    {
        _logger = logger;
        _context = context;
    }

    public void CalculateAvgPriceJob()
    {
        try
        {
            var candleSticks = _context.CandleSticks.ToList();

            foreach (var candleStick in candleSticks)
            {
                double avgPrice = (candleStick.Low + candleStick.High) / 2.0;

                candleStick.AvgPrice = avgPrice;
            }

            _context.SaveChanges();

            _logger.LogInformation("Successfully updated AvgPrice for all CandleSticks.");
        }
        catch (Exception ex)
        {
            _logger.LogError(ex, "Error occurred while calculating AvgPrice");
            throw;
        }
    }
}

}

And then I’ve used it as a Controller Action Method:

public IActionResult ScheduleAvgPriceJob()
{
RecurringJob.AddOrUpdate(“CalculateAvgPrice”, () => _backgroundJobClient.Enqueue(job => job.CalculateAvgPriceJob()), “*/10 * * * * *”);

        return RedirectToAction(nameof(Index));
    }

Problem is when I go to Hangfire Dashboard, in recurring jobs tab there is no services and when I’ve tested it locally with another action method to trigger the method, it throwed me the exception I’ve mentioned earlier…

This is my Hangfire configuration in Program.cs file:

builder.Services.AddHangfire(configuration =>
{
configuration
.SetDataCompatibilityLevel(CompatibilityLevel.Version_180)
.UseSimpleAssemblyNameTypeSerializer()
.UseRecommendedSerializerSettings()
.UseSqlServerStorage(builder.Configuration.GetConnectionString(“HangfireConnection”));
});