I’m trying to create a job in an ASP.NET (C#) form using Quartz.NET, and here’s what I have so far:
JobDetail jobDetail = new JobDetail(count + "_job", schedID, typeof(HTTPtoFTP));
Problem is, I don’t want to link directly to the HTTPtoFTP class, because depending on what the user picks on the form , it’ll link to a seperate class. I’ve tried using a variable in place of HTTPtoFTP, but I get the error:
The type or namespace ‘mergedJobType’ could not be found (are you missing a using directive or an assembly reference?)
Why is this? I guess one way to do this is an IF statement where I just copy the line and change the typeof for each possibility, but it seems like I’d have to replicate all the other lines that refer to jobDetail too.
Unless I’m missing something, I think what you are looking for is
mergedJobType.GetType()That returns the type object of an object’s class.