I am trying to work with Quartz.NET in F# and have run into a few issues with the fact that, while Quartz.NET is usable in F#, there does not seem to be much documentation on it, and I've had some difficulty with differences between it and what can find in C#.
One issue I have currently run into is setting SystemTime such as shown in this question, Quartz.net + testing with SystemTime.UtcNow.
I could be wrong, but I thought that the code in F# should be:
SystemTime.Now = fun () -> DateTime(someDate)
SystemTime.UtcNow = fun () -> DateTime(someDate)
But I get an error about either too many arguments or function used where not expected. If I just use the DateTime constructor, I get an error related to the fact it is expecting a function.
The single
=
is an equality comparison operation. If you want to do assignment, use the<-
assignment operator.Apart from that, F# functions aren't the same as
Func<T>
. Normally, when you use them as method arguments, the conversion happens automatically, but in this case, it seems you'll need to explicitly perform the conversion:To invoke them from F# is also a bit more involved: