I’ve got a simple console app as a Proof of Concept.
In my main method I have a line:
BackgroundJob.Enqueue<Test>((t) => Console.WriteLine(t.Sum(3,4)));
My Test class looks like this:
public class Test
{
public Test(){ }
public int Sum(int a, int b)
{
return a + b;
}
}
When i F5 my program I get an exception on the line with Enqueue:
"An unhandled exception of type ‘System.InvalidOperationException’ occurred in System.Core.dll
Additional information: variable ‘t’ of type ‘HangfireTest.Test’ referenced from scope ‘’, but it is not defined"
What am I doing wrong here?