I may of worded the title completely wrong, but basically, I have the following base class:
public class ScheduleableService<T> : ServiceBase
where T : IJob
{
var x = typeof(T);
}
The implementation of this is something like:
public class MyScheduledService: ScheduleableService<MyScheduledJob>
{
//MyScheduledJob implements IJob
}
Basically, what I need, is in my base class ScheduleableService, to be able to get hold of the MyScheduledService type- Is there any way I can do this without passing it in.
The following works, however is ugly.....
public class ScheduleableService<T, S> : ServiceBase
where T : IJob
where S : ServiceBase
{
var x = typeof(T);
var y = typeof(S);
}
implementation:
public class MyScheduledService: ScheduleableService<MyScheduledJob,
MyScheduledService>
{
//MyScheduledJob implements IJob
}