Я реализовал имя метода GetApiData()
. Я хочу вызывать этот метод в минуту, используя hangfire
повторяющееся задание. Но когда я вызываю этот метод, он показывает ошибку
System.ArgumentNullException: Value cannot be null.
Parameter name: method
at Hangfire.Common.Job..ctor(Type type, MethodInfo method, Object[] args)
at Hangfire.Common.Job.FromExpression(LambdaExpression methodCall, Type explicitType)
at Raasforce.Crm.ContactRepositoriesAppService.APIDataBackgroundJob() in E:\RaasforceCorp\RaasforceCorp\aspnet-core\src\Raasforce.Application\Crm\ContactRepositoriesAppService.cs:line 795
at Microsoft.Extensions.Internal.ObjectMethodExecutor.<>c__DisplayClass33_0.<WrapVoidMethod>b__0(Object target, Object[] parameters)
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.VoidResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
Какой будет правильный синтаксис? Показывает ошибку времени выполнения.
public void APIDataBackgroundJob()
{
RecurringJob.AddOrUpdate(()=>GetApiData(),Cron.Minutely);//This line is showing error
}